Re: [PATCH V2] mmc: core: cd_label must be last entry of mmc_gpio struct

2018-07-09 Thread Linus Walleij
On Tue, Jul 3, 2018 at 7:35 AM Ulf Hansson wrote: > On 3 July 2018 at 04:25, Fabio Estevam wrote: > > On Mon, Jul 2, 2018 at 11:13 PM, Anson Huang wrote: > > > >> I think either way is OK, since flexible array is used in kernel code > >> quite commonly, > >> so I prefer to make code change as

Re: [PATCH V2] mmc: core: cd_label must be last entry of mmc_gpio struct

2018-07-09 Thread Linus Walleij
On Tue, Jul 3, 2018 at 7:35 AM Ulf Hansson wrote: > On 3 July 2018 at 04:25, Fabio Estevam wrote: > > On Mon, Jul 2, 2018 at 11:13 PM, Anson Huang wrote: > > > >> I think either way is OK, since flexible array is used in kernel code > >> quite commonly, > >> so I prefer to make code change as

Re: [PATCH V2] mmc: core: cd_label must be last entry of mmc_gpio struct

2018-07-04 Thread Andy Shevchenko
On Mon, Jul 2, 2018 at 2:42 PM, Linus Walleij wrote: > On Mon, Jul 2, 2018 at 3:32 AM Anson Huang wrote: >> - char cd_label[0]; >> + char cd_label[]; > > Not that I am the smartest in the world when it comes to how the > C compilers work this out. > > But isn't that equivalent to: >

Re: [PATCH V2] mmc: core: cd_label must be last entry of mmc_gpio struct

2018-07-04 Thread Andy Shevchenko
On Mon, Jul 2, 2018 at 2:42 PM, Linus Walleij wrote: > On Mon, Jul 2, 2018 at 3:32 AM Anson Huang wrote: >> - char cd_label[0]; >> + char cd_label[]; > > Not that I am the smartest in the world when it comes to how the > C compilers work this out. > > But isn't that equivalent to: >

Re: [PATCH V2] mmc: core: cd_label must be last entry of mmc_gpio struct

2018-07-02 Thread Ulf Hansson
On 3 July 2018 at 04:25, Fabio Estevam wrote: > On Mon, Jul 2, 2018 at 11:13 PM, Anson Huang wrote: > >> I think either way is OK, since flexible array is used in kernel code quite >> commonly, >> so I prefer to make code change as small as possible, the original patch can >> also prevent >>

Re: [PATCH V2] mmc: core: cd_label must be last entry of mmc_gpio struct

2018-07-02 Thread Ulf Hansson
On 3 July 2018 at 04:25, Fabio Estevam wrote: > On Mon, Jul 2, 2018 at 11:13 PM, Anson Huang wrote: > >> I think either way is OK, since flexible array is used in kernel code quite >> commonly, >> so I prefer to make code change as small as possible, the original patch can >> also prevent >>

Re: [PATCH V2] mmc: core: cd_label must be last entry of mmc_gpio struct

2018-07-02 Thread Fabio Estevam
On Mon, Jul 2, 2018 at 11:13 PM, Anson Huang wrote: > I think either way is OK, since flexible array is used in kernel code quite > commonly, > so I prefer to make code change as small as possible, the original patch can > also prevent > similar bug in future. And like below commit Fabio

Re: [PATCH V2] mmc: core: cd_label must be last entry of mmc_gpio struct

2018-07-02 Thread Fabio Estevam
On Mon, Jul 2, 2018 at 11:13 PM, Anson Huang wrote: > I think either way is OK, since flexible array is used in kernel code quite > commonly, > so I prefer to make code change as small as possible, the original patch can > also prevent > similar bug in future. And like below commit Fabio

RE: [PATCH V2] mmc: core: cd_label must be last entry of mmc_gpio struct

2018-07-02 Thread Anson Huang
Fabio Estevam ; > linux-mmc ; linux-kernel@vger.kernel.org; > dl-linux-imx > Subject: Re: [PATCH V2] mmc: core: cd_label must be last entry of mmc_gpio > struct > > On Mon, Jul 2, 2018 at 3:32 AM Anson Huang > wrote: > > > commit bfd694d5e21c ("mmc: c

RE: [PATCH V2] mmc: core: cd_label must be last entry of mmc_gpio struct

2018-07-02 Thread Anson Huang
Fabio Estevam ; > linux-mmc ; linux-kernel@vger.kernel.org; > dl-linux-imx > Subject: Re: [PATCH V2] mmc: core: cd_label must be last entry of mmc_gpio > struct > > On Mon, Jul 2, 2018 at 3:32 AM Anson Huang > wrote: > > > commit bfd694d5e21c ("mmc: c

Re: [PATCH V2] mmc: core: cd_label must be last entry of mmc_gpio struct

2018-07-02 Thread Fabio Estevam
Hi Linus, On Mon, Jul 2, 2018 at 8:42 AM, Linus Walleij wrote: > What about this: > > From facb3799f479bfd4dad99c25c9c5d4c77b14c9b0 Mon Sep 17 00:00:00 2001 > From: Linus Walleij > Date: Mon, 2 Jul 2018 13:35:01 +0200 > Subject: [PATCH] mmc: slot-gpio: Allocate GPIO labels dynamically > > The

Re: [PATCH V2] mmc: core: cd_label must be last entry of mmc_gpio struct

2018-07-02 Thread Fabio Estevam
Hi Linus, On Mon, Jul 2, 2018 at 8:42 AM, Linus Walleij wrote: > What about this: > > From facb3799f479bfd4dad99c25c9c5d4c77b14c9b0 Mon Sep 17 00:00:00 2001 > From: Linus Walleij > Date: Mon, 2 Jul 2018 13:35:01 +0200 > Subject: [PATCH] mmc: slot-gpio: Allocate GPIO labels dynamically > > The

Re: [PATCH V2] mmc: core: cd_label must be last entry of mmc_gpio struct

2018-07-02 Thread Linus Walleij
On Mon, Jul 2, 2018 at 3:32 AM Anson Huang wrote: > commit bfd694d5e21c ("mmc: core: Add tunable delay > before detecting card after card is inserted") adds > "u32 cd_debounce_delay_ms" to the last of mmc_gpio > struct and cause "char cd_label[0]" NOT work as string > pointer of card detect

Re: [PATCH V2] mmc: core: cd_label must be last entry of mmc_gpio struct

2018-07-02 Thread Linus Walleij
On Mon, Jul 2, 2018 at 3:32 AM Anson Huang wrote: > commit bfd694d5e21c ("mmc: core: Add tunable delay > before detecting card after card is inserted") adds > "u32 cd_debounce_delay_ms" to the last of mmc_gpio > struct and cause "char cd_label[0]" NOT work as string > pointer of card detect