From: Julia Lawall <julia.lawall@inria.fr>
To: kbuild-all@lists.01.org
Subject: [PATCH] FROMLIST: HID: nintendo: fix flexible_array.cocci warnings
Date: Fri, 14 May 2021 14:44:16 +0200 [thread overview]
Message-ID: <alpine.DEB.2.22.394.2105141442260.13663@hadrien> (raw)
[-- 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 {
next reply other threads:[~2021-05-14 12:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-14 12:44 Julia Lawall [this message]
2021-05-14 14:04 ` [PATCH] FROMLIST: HID: nintendo: fix flexible_array.cocci warnings 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.22.394.2105141442260.13663@hadrien \
--to=julia.lawall@inria.fr \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.