Content-Type: multipart/mixed; boundary="===============6710135333525764961==" MIME-Version: 1.0 From: Julia Lawall To: kbuild-all@lists.01.org Subject: Re: [PATCH] FROMLIST: HID: nintendo: fix flexible_array.cocci warnings Date: Fri, 14 May 2021 16:40:10 +0200 Message-ID: In-Reply-To: <20210514140414.GF805368@dell> List-Id: --===============6710135333525764961== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 cont= roller driver") > > CC: Daniel J. Ogorchock > > Reported-by: kernel test robot > > Signed-off-by: kernel test robot > > Signed-off-by: Julia Lawall > > --- > > > > 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: HI= D: 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 [=E6=9D=8E=E7=90=BC=E6=96=AF] > Senior Technical Lead - Developer Services > Linaro.org =E2=94=82 Open source software for Arm SoCs > Follow Linaro: Facebook | Twitter | Blog > --===============6710135333525764961==--