mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Johnson <quic_jjohnson@quicinc.com>
To: Greg KH <gregkh@linuxfoundation.org>, Kalle Valo <kvalo@kernel.org>
Cc: Atul Raut <rauji.raut@gmail.com>,
	<linux-kernel-mentees@lists.linuxfoundation.org>,
	<linux-wireless@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] ath6kl: replace one-element array with flexible-array member
Date: Mon, 7 Aug 2023 07:13:20 -0700	[thread overview]
Message-ID: <47f1a06b-8bfe-911a-3a05-da7d522b588f@quicinc.com> (raw)
In-Reply-To: <2023080410-unadorned-vertigo-c0b8@gregkh>

On 8/4/2023 2:30 AM, Greg KH wrote:
> On Fri, Aug 04, 2023 at 10:10:37AM +0300, Kalle Valo wrote:
>> Greg KH <gregkh@linuxfoundation.org> writes:
>>
>>> On Thu, Aug 03, 2023 at 09:55:54PM -0700, Atul Raut wrote:
>>>
>>>> One-element arrays are no longer relevant, and their
>>>> place has been taken by flexible array members thus,
>>>> use a flexible-array member to replace the one-element
>>>> array in struct ath6kl_usb_ctrl_diag_cmd_write
>>>>
>>>> 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..c8ecc9e85897 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];
>>>> +	__le32 _pad[];
>>>
>>> Are you sure this is actually a variable length array?
>>
>> It's not, it's just padding. We both told this in v1:
>>
>> https://patchwork.kernel.org/project/linux-wireless/patch/20230731012941.21875-1-rauji.raut@gmail.com/
> 
> Hey, I'm consistent, nice!  :)
> 
> But Atul, that's not good to ignore our review comments.  Usually that
> ends up meaning that everyone will then just ignore your submissions,
> generally a not-good resolution.
> 
> thanks,
> 
> greg k-h

Since the 'pad' field is never directly accessed, suggest the author 
respin this this to use simply:
	__le32 _pad;

That will prevent others from trying to "fix" this actual one-element 
array in the future.

  reply	other threads:[~2023-08-07 14:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04  4:55 Atul Raut
2023-08-04  5:15 ` Greg KH
2023-08-04  7:10   ` Kalle Valo
2023-08-04  9:30     ` Greg KH
2023-08-07 14:13       ` Jeff Johnson [this message]
2023-08-07 15:17         ` Atul Raut
2023-08-07 15:31         ` Atul Raut

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=47f1a06b-8bfe-911a-3a05-da7d522b588f@quicinc.com \
    --to=quic_jjohnson@quicinc.com \
    --cc=gregkh@linuxfoundation.org \
    --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

all inboxes | Powered by JetHome®