All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] FROMLIST: HID: nintendo: fix flexible_array.cocci warnings
@ 2021-05-14 12:44 Julia Lawall
  2021-05-14 14:04 ` Lee Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2021-05-14 12:44 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1562 bytes --]

 Zero-length and one-element arrays are deprecated, see
 Documentation/process/deprecated.rst
 Flexible-array members should be used instead.

Generated by: scripts/coccinelle/misc/flexible_array.cocci

Fixes: f4dc6237a840 ("FROMLIST: HID: nintendo: add nintendo switch controller driver")
CC: Daniel J. Ogorchock <djogorchock@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

tree:   https://git.linaro.org/people/lee.jones/linux.git aosp-android-mainline-tracking
head:   9b2a8deb96b1f9d4cc52497c4559f187db0408e1
commit: f4dc6237a840e52e0ecd3c46393af5b98029f650 [307/599] FROMLIST: HID: nintendo: add nintendo switch controller driver
:::::: branch date: 5 hours ago
:::::: commit date: 5 hours ago

Please take the patch only if it's a positive warning. Thanks!

 hid-nintendo.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -152,13 +152,13 @@ struct joycon_subcmd_request {
 	u8 packet_num; /* incremented every send */
 	u8 rumble_data[8];
 	u8 subcmd_id;
-	u8 data[0]; /* length depends on the subcommand */
+	u8 data[]; /* length depends on the subcommand */
 } __packed;

 struct joycon_subcmd_reply {
 	u8 ack; /* MSB 1 for ACK, 0 for NACK */
 	u8 id; /* id of requested subcmd */
-	u8 data[0]; /* will be at most 35 bytes */
+	u8 data[]; /* will be at most 35 bytes */
 } __packed;

 struct joycon_input_report {

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] FROMLIST: HID: nintendo: fix flexible_array.cocci warnings
  2021-05-14 12:44 [PATCH] FROMLIST: HID: nintendo: fix flexible_array.cocci warnings Julia Lawall
@ 2021-05-14 14:04 ` Lee Jones
  2021-05-14 14:40   ` Julia Lawall
  0 siblings, 1 reply; 5+ messages in thread
From: Lee Jones @ 2021-05-14 14:04 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1950 bytes --]

On Fri, 14 May 2021, Julia Lawall wrote:

>  Zero-length and one-element arrays are deprecated, see
>  Documentation/process/deprecated.rst
>  Flexible-array members should be used instead.
> 
> Generated by: scripts/coccinelle/misc/flexible_array.cocci
> 
> Fixes: f4dc6237a840 ("FROMLIST: HID: nintendo: add nintendo switch controller driver")
> CC: Daniel J. Ogorchock <djogorchock@gmail.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
> ---
> 
> tree:   https://git.linaro.org/people/lee.jones/linux.git aosp-android-mainline-tracking

Please refrain from sending patches based on this tree.

It's mainly used for hacking.

> head:   9b2a8deb96b1f9d4cc52497c4559f187db0408e1
> commit: f4dc6237a840e52e0ecd3c46393af5b98029f650 [307/599] FROMLIST: HID: nintendo: add nintendo switch controller driver
> :::::: branch date: 5 hours ago
> :::::: commit date: 5 hours ago
> 
> Please take the patch only if it's a positive warning. Thanks!
> 
>  hid-nintendo.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- a/drivers/hid/hid-nintendo.c
> +++ b/drivers/hid/hid-nintendo.c
> @@ -152,13 +152,13 @@ struct joycon_subcmd_request {
>  	u8 packet_num; /* incremented every send */
>  	u8 rumble_data[8];
>  	u8 subcmd_id;
> -	u8 data[0]; /* length depends on the subcommand */
> +	u8 data[]; /* length depends on the subcommand */
>  } __packed;
> 
>  struct joycon_subcmd_reply {
>  	u8 ack; /* MSB 1 for ACK, 0 for NACK */
>  	u8 id; /* id of requested subcmd */
> -	u8 data[0]; /* will be at most 35 bytes */
> +	u8 data[]; /* will be at most 35 bytes */
>  } __packed;
> 
>  struct joycon_input_report {

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] FROMLIST: HID: nintendo: fix flexible_array.cocci warnings
  2021-05-14 14:04 ` Lee Jones
@ 2021-05-14 14:40   ` Julia Lawall
  2021-05-14 15:27     ` Chen, Rong A
  0 siblings, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2021-05-14 14:40 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2208 bytes --]



On Fri, 14 May 2021, Lee Jones wrote:

> On Fri, 14 May 2021, Julia Lawall wrote:
>
> >  Zero-length and one-element arrays are deprecated, see
> >  Documentation/process/deprecated.rst
> >  Flexible-array members should be used instead.
> >
> > Generated by: scripts/coccinelle/misc/flexible_array.cocci
> >
> > Fixes: f4dc6237a840 ("FROMLIST: HID: nintendo: add nintendo switch controller driver")
> > CC: Daniel J. Ogorchock <djogorchock@gmail.com>
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
> > ---
> >
> > tree:   https://git.linaro.org/people/lee.jones/linux.git aosp-android-mainline-tracking
>
> Please refrain from sending patches based on this tree.
>
> It's mainly used for hacking.

OK, I guess that the 0-day people will notice this and remove it from the
list of checked trees.

julia

>
> > head:   9b2a8deb96b1f9d4cc52497c4559f187db0408e1
> > commit: f4dc6237a840e52e0ecd3c46393af5b98029f650 [307/599] FROMLIST: HID: nintendo: add nintendo switch controller driver
> > :::::: branch date: 5 hours ago
> > :::::: commit date: 5 hours ago
> >
> > Please take the patch only if it's a positive warning. Thanks!
> >
> >  hid-nintendo.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > --- a/drivers/hid/hid-nintendo.c
> > +++ b/drivers/hid/hid-nintendo.c
> > @@ -152,13 +152,13 @@ struct joycon_subcmd_request {
> >  	u8 packet_num; /* incremented every send */
> >  	u8 rumble_data[8];
> >  	u8 subcmd_id;
> > -	u8 data[0]; /* length depends on the subcommand */
> > +	u8 data[]; /* length depends on the subcommand */
> >  } __packed;
> >
> >  struct joycon_subcmd_reply {
> >  	u8 ack; /* MSB 1 for ACK, 0 for NACK */
> >  	u8 id; /* id of requested subcmd */
> > -	u8 data[0]; /* will be at most 35 bytes */
> > +	u8 data[]; /* will be at most 35 bytes */
> >  } __packed;
> >
> >  struct joycon_input_report {
>
> --
> Lee Jones [李琼斯]
> Senior Technical Lead - Developer Services
> Linaro.org │ Open source software for Arm SoCs
> Follow Linaro: Facebook | Twitter | Blog
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] FROMLIST: HID: nintendo: fix flexible_array.cocci warnings
  2021-05-14 14:40   ` Julia Lawall
@ 2021-05-14 15:27     ` Chen, Rong A
  0 siblings, 0 replies; 5+ messages in thread
From: Chen, Rong A @ 2021-05-14 15:27 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2587 bytes --]



On 5/14/2021 10:40 PM, Julia Lawall wrote:
> 
> 
> On Fri, 14 May 2021, Lee Jones wrote:
> 
>> On Fri, 14 May 2021, Julia Lawall wrote:
>>
>>>   Zero-length and one-element arrays are deprecated, see
>>>   Documentation/process/deprecated.rst
>>>   Flexible-array members should be used instead.
>>>
>>> Generated by: scripts/coccinelle/misc/flexible_array.cocci
>>>
>>> Fixes: f4dc6237a840 ("FROMLIST: HID: nintendo: add nintendo switch controller driver")
>>> CC: Daniel J. Ogorchock <djogorchock@gmail.com>
>>> Reported-by: kernel test robot <lkp@intel.com>
>>> Signed-off-by: kernel test robot <lkp@intel.com>
>>> Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
>>> ---
>>>
>>> tree:   https://git.linaro.org/people/lee.jones/linux.git aosp-android-mainline-tracking
>>
>> Please refrain from sending patches based on this tree.
>>
>> It's mainly used for hacking.
> 
> OK, I guess that the 0-day people will notice this and remove it from the
> list of checked trees.

Hi all,

Thanks for the information, we'll ignore the branch.

Best Regards,
Rong Chen


> 
> julia
> 
>>
>>> head:   9b2a8deb96b1f9d4cc52497c4559f187db0408e1
>>> commit: f4dc6237a840e52e0ecd3c46393af5b98029f650 [307/599] FROMLIST: HID: nintendo: add nintendo switch controller driver
>>> :::::: branch date: 5 hours ago
>>> :::::: commit date: 5 hours ago
>>>
>>> Please take the patch only if it's a positive warning. Thanks!
>>>
>>>   hid-nintendo.c |    4 ++--
>>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> --- a/drivers/hid/hid-nintendo.c
>>> +++ b/drivers/hid/hid-nintendo.c
>>> @@ -152,13 +152,13 @@ struct joycon_subcmd_request {
>>>   	u8 packet_num; /* incremented every send */
>>>   	u8 rumble_data[8];
>>>   	u8 subcmd_id;
>>> -	u8 data[0]; /* length depends on the subcommand */
>>> +	u8 data[]; /* length depends on the subcommand */
>>>   } __packed;
>>>
>>>   struct joycon_subcmd_reply {
>>>   	u8 ack; /* MSB 1 for ACK, 0 for NACK */
>>>   	u8 id; /* id of requested subcmd */
>>> -	u8 data[0]; /* will be at most 35 bytes */
>>> +	u8 data[]; /* will be at most 35 bytes */
>>>   } __packed;
>>>
>>>   struct joycon_input_report {
>>
>> --
>> Lee Jones [李琼斯]
>> Senior Technical Lead - Developer Services
>> Linaro.org │ Open source software for Arm SoCs
>> Follow Linaro: Facebook | Twitter | Blog
>>
> 
> 
> _______________________________________________
> kbuild-all mailing list -- kbuild-all(a)lists.01.org
> To unsubscribe send an email to kbuild-all-leave(a)lists.01.org
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] FROMLIST: HID: nintendo: fix flexible_array.cocci warnings
  2021-05-13 16:00 [lee-linaro:aosp-android-mainline-tracking 307/599] drivers/hid/hid-nintendo.c:155:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) kernel test robot
@ 2021-05-13 16:00 ` kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2021-05-13 16:00 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1987 bytes --]

CC: kbuild-all(a)lists.01.org
TO: Lee Jones <lee.jones@linaro.org>

From: kernel test robot <lkp@intel.com>

drivers/hid/hid-nintendo.c:155:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays)
drivers/hid/hid-nintendo.c:161:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays)


 Zero-length and one-element arrays are deprecated, see
 Documentation/process/deprecated.rst
 Flexible-array members should be used instead.

Generated by: scripts/coccinelle/misc/flexible_array.cocci

Fixes: f4dc6237a840 ("FROMLIST: HID: nintendo: add nintendo switch controller driver")
CC: Daniel J. Ogorchock <djogorchock@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://git.linaro.org/people/lee.jones/linux.git aosp-android-mainline-tracking
head:   9b2a8deb96b1f9d4cc52497c4559f187db0408e1
commit: f4dc6237a840e52e0ecd3c46393af5b98029f650 [307/599] FROMLIST: HID: nintendo: add nintendo switch controller driver
:::::: branch date: 5 hours ago
:::::: commit date: 5 hours ago

Please take the patch only if it's a positive warning. Thanks!

 hid-nintendo.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -152,13 +152,13 @@ struct joycon_subcmd_request {
 	u8 packet_num; /* incremented every send */
 	u8 rumble_data[8];
 	u8 subcmd_id;
-	u8 data[0]; /* length depends on the subcommand */
+	u8 data[]; /* length depends on the subcommand */
 } __packed;
 
 struct joycon_subcmd_reply {
 	u8 ack; /* MSB 1 for ACK, 0 for NACK */
 	u8 id; /* id of requested subcmd */
-	u8 data[0]; /* will be at most 35 bytes */
+	u8 data[]; /* will be at most 35 bytes */
 } __packed;
 
 struct joycon_input_report {

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-14 15:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14 12:44 [PATCH] FROMLIST: HID: nintendo: fix flexible_array.cocci warnings Julia Lawall
2021-05-14 14:04 ` Lee Jones
2021-05-14 14:40   ` Julia Lawall
2021-05-14 15:27     ` Chen, Rong A
  -- strict thread matches above, loose matches on Subject: below --
2021-05-13 16:00 [lee-linaro:aosp-android-mainline-tracking 307/599] drivers/hid/hid-nintendo.c:155:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) kernel test robot
2021-05-13 16:00 ` [PATCH] FROMLIST: HID: nintendo: fix flexible_array.cocci warnings kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.