netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Maya Erez <merez@codeaurora.org>,
	"David S. Miller" <davem@davemloft.net>,
	Arnd Bergmann <arnd@arndb.de>,
	Dedy Lansky <dlansky@codeaurora.org>,
	Ahmad Masri <amasri@codeaurora.org>,
	Alexei Avshalom Lazar <ailizaro@codeaurora.org>,
	Tzahi Sabo <stzahi@codeaurora.org>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	Lior David <liord@codeaurora.org>,
	linux-wireless@vger.kernel.org, wil6210@qti.qualcomm.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] wil6210: avoid gcc-10 zero-length-bounds warning
Date: Mon, 11 May 2020 12:33:52 +0000 (UTC)	[thread overview]
Message-ID: <20200511123352.D753CC43637@smtp.codeaurora.org> (raw)
In-Reply-To: <20200505143332.1398524-1-arnd@arndb.de>

Arnd Bergmann <arnd@arndb.de> wrote:

> gcc-10 warns about accesses inside of a zero-length array:
> 
> drivers/net/wireless/ath/wil6210/cfg80211.c: In function 'wil_cfg80211_scan':
> drivers/net/wireless/ath/wil6210/cfg80211.c:970:23: error: array subscript 255 is outside the bounds of an interior zero-length array 'struct <anonymous>[0]' [-Werror=zero-length-bounds]
>   970 |   cmd.cmd.channel_list[cmd.cmd.num_channels++].channel = ch - 1;
>       |   ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
> In file included from drivers/net/wireless/ath/wil6210/wil6210.h:17,
>                  from drivers/net/wireless/ath/wil6210/cfg80211.c:11:
> drivers/net/wireless/ath/wil6210/wmi.h:477:4: note: while referencing 'channel_list'
>   477 |  } channel_list[0];
>       |    ^~~~~~~~~~~~
> 
> Turn this into a flexible array to avoid the warning.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

04a4d3416372 wil6210: avoid gcc-10 zero-length-bounds warning

-- 
https://patchwork.kernel.org/patch/11529309/

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

      parent reply	other threads:[~2020-05-11 12:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 14:33 [PATCH] wil6210: avoid gcc-10 zero-length-bounds warning Arnd Bergmann
2020-05-05 15:44 ` Kalle Valo
2020-05-11 12:33 ` Kalle Valo [this message]

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=20200511123352.D753CC43637@smtp.codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=ailizaro@codeaurora.org \
    --cc=amasri@codeaurora.org \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=dlansky@codeaurora.org \
    --cc=gustavo@embeddedor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=liord@codeaurora.org \
    --cc=merez@codeaurora.org \
    --cc=netdev@vger.kernel.org \
    --cc=stzahi@codeaurora.org \
    --cc=wil6210@qti.qualcomm.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).