netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Voon Weifeng <weifeng.voon@intel.com>,
	Ong Boon Leong <boon.leong.ong@intel.com>,
	Arnd Bergmann <arnd@arndb.de>, kernel test robot <lkp@intel.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Networking <netdev@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [RESEND] net: stmmac: fix gcc-10 -Wrestrict warning
Date: Mon, 27 Sep 2021 15:59:27 +0200	[thread overview]
Message-ID: <CAK8P3a2-F-vAL5-gewVh3JvnD1a9yXWYLKN9fi6CEe86Hnhn+A@mail.gmail.com> (raw)
In-Reply-To: <YVHGblt9rYg7kbWR@shell.armlinux.org.uk>

On Mon, Sep 27, 2021 at 3:27 PM Russell King (Oracle)
<linux@armlinux.org.uk> wrote:
> On Mon, Sep 27, 2021 at 12:02:44PM +0200, Arnd Bergmann wrote:
>
> This looks rather weird. rx_irq[] is defined as:
>
>         int rx_irq[MTL_MAX_RX_QUEUES];
>
> If "i" were to become MTL_MAX_RX_QUEUES, then the above code overlows
> the array.
>
> So while this may stop gcc-10 complaining, I'd argue that making the
> new test ">=" rather than ">" would have also made it look correct.

Indeed, thanks for pointing this out. I have sent a follow-up with
that change now.

             Arnd

      reply	other threads:[~2021-09-27 13:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27 10:02 [PATCH] [RESEND] net: stmmac: fix gcc-10 -Wrestrict warning Arnd Bergmann
2021-09-27 13:00 ` patchwork-bot+netdevbpf
2021-09-27 13:26 ` Russell King (Oracle)
2021-09-27 13:59   ` Arnd Bergmann [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=CAK8P3a2-F-vAL5-gewVh3JvnD1a9yXWYLKN9fi6CEe86Hnhn+A@mail.gmail.com \
    --to=arnd@kernel.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=arnd@arndb.de \
    --cc=boon.leong.ong@intel.com \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lkp@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=weifeng.voon@intel.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).