lkml.org 
[lkml]   [2023]   [Aug]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] ath6kl: replace one-element array with flexible-array member
Date
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/

> And you just changed the size of this structure, are you sure this is
> correct?

This patch is not correct.

Atul, ALWAYS include a changelog when submitting a new version. Please
carefully read our wiki link below before submitting new patches to
wireless.

--
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

\
 
 \ /
  Last update: 2023-08-04 09:12    [W:0.038 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site