From: Greg KH <greg@kroah.com>
To: Atul Raut <rauji.raut@gmail.com>
Cc: kvalo@kernel.org, linux-kernel-mentees@lists.linuxfoundation.org,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ath6kl: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper
Date: Mon, 31 Jul 2023 08:05:52 +0200 [thread overview]
Message-ID: <2023073103-basket-ranking-b6e6@gregkh> (raw)
In-Reply-To: <20230731012941.21875-1-rauji.raut@gmail.com>
On Sun, Jul 30, 2023 at 06:29:41PM -0700, Atul Raut wrote:
> Because zero-length arrays are obsolete, replacing them with
> C99 flexible-array members.
> Instead of defining a zero-length array, use the new
> DECLARE_FLEX_ARRAY() auxiliary macro.
>
> This fixes warnings such as:
> ./drivers/net/wireless/ath/ath6kl/usb.c:109:8-12: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays)
>
> Signed-off-by: Atul Raut <rauji.raut@gmail.com>
> ---
> drivers/net/wireless/ath/ath6kl/usb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c
> index 5220809841a6..bb3771a3897c 100644
> --- a/drivers/net/wireless/ath/ath6kl/usb.c
> +++ b/drivers/net/wireless/ath/ath6kl/usb.c
> @@ -106,7 +106,7 @@ struct ath6kl_usb_ctrl_diag_cmd_write {
> __le32 cmd;
> __le32 address;
> __le32 value;
> - __le32 _pad[1];
> + DECLARE_FLEX_ARRAY(__le32, _pad);
This is not a 0 length array, or a variable array. Look at the work
done on the hardening mailing list for more details, I think this is
wrong.
good luck!
greg k-h
next prev parent reply other threads:[~2023-07-31 6:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-31 1:29 [PATCH] ath6kl: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper Atul Raut
2023-07-31 6:05 ` Greg KH [this message]
2023-08-01 14:42 ` Kalle Valo
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=2023073103-basket-ranking-b6e6@gregkh \
--to=greg@kroah.com \
--cc=kvalo@kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=rauji.raut@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).