public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jérôme Pouiller" <jerome.pouiller@silabs.com>
To: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org,
	Muhammad Usama Anjum <musamaanjum@gmail.com>
Subject: Re: [PATCH] staging: wfx: avoid defining array of flexible struct
Date: Thu, 11 Feb 2021 13:45:43 +0100	[thread overview]
Message-ID: <6775209.aHiZMU1OZ3@pc-42> (raw)
In-Reply-To: <20210211105026.GA45458@LEGION>

On Thursday 11 February 2021 11:50:26 CET Muhammad Usama Anjum wrote:
> 
> In this particular case, the struct element is already flexible struct.
> Thus struct element ie[] is ambiguous inside another struct. The members
> of struct element ie aren't being accessed in code anywhere. The data of
> u8 type is copied in it. So it has been changed to u8 ie[] to make the
> sparse happy and code simple.

You may also mention that the driver code does not care of the type of
the ie attribute. It is only accessed from one place with memcpy().

> 
> Warning from sparse:
> drivers/stagingwfx/hif_tx.c: note: in included file (through drivers/stagingwfx/data_tx.h, drivers/staging//wfx/wfx.h):
> drivers/staging//wfx/hif_api_cmd.h:103:26: warning: array of flexible structures
> 
> Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
> ---
>  drivers/staging/wfx/hif_api_cmd.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h
> index 11bc1a58edae..58c9bb036011 100644
> --- a/drivers/staging/wfx/hif_api_cmd.h
> +++ b/drivers/staging/wfx/hif_api_cmd.h
> @@ -100,7 +100,7 @@ struct hif_req_update_ie {
>         u8     reserved1:5;
>         u8     reserved2;
>         __le16 num_ies;
> -       struct element ie[];
> +       u8     ie[];
>  } __packed;
> 
>  struct hif_cnf_update_ie {
> --
> 2.25.1
> 
> 

I think that "#include <linux/ieee80211.h>" is no more necessary.

Else:

Reviewed-by: Jérôme Pouiller <jerome.pouiller@silabs.com>

-- 
Jérôme Pouiller



  reply	other threads:[~2021-02-11 13:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-11 10:50 [PATCH] staging: wfx: avoid defining array of flexible struct Muhammad Usama Anjum
2021-02-11 12:45 ` Jérôme Pouiller [this message]
2021-02-11 13:55   ` Muhammad Usama Anjum

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=6775209.aHiZMU1OZ3@pc-42 \
    --to=jerome.pouiller@silabs.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=musamaanjum@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