All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: geert@linux-m68k.org
Cc: sammy@sammy.net, netdev@vger.kernel.org,
	linux-m68k@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/sun3_82586: Kill array subscript above array bounds warning
Date: Wed, 17 Jul 2013 18:22:37 -0700 (PDT)	[thread overview]
Message-ID: <20130717.182237.906875287830581782.davem@davemloft.net> (raw)
In-Reply-To: <1374063905-4050-1-git-send-email-geert@linux-m68k.org>

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Wed, 17 Jul 2013 14:25:05 +0200

> drivers/net/ethernet/i825xx/sun3_82586.c: In function 'sun3_82586_timeout':
> drivers/net/ethernet/i825xx/sun3_82586.c:993:89: warning: array subscript is above array bounds [-Warray-bounds]
> 
> Using the default NUM_XMIT_BUFFS = 1, there's only one transmit buffer.
> Hence accessing the second buffer is an out-of-bounds access.
> Print the command status of the first NOP buffer instead.
> 
> Fortunately this actually worked fine, as the layout of transmit and NOP
> buffers is sufficiently similar.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Three more CPP directives in a DEBUG ifdef'd piece of code, yuck.

I'd say just kill this whole DEBUG section entirely.  If people
want this driver to print this debugging, do it properly with
netif_err() or similar.

  reply	other threads:[~2013-07-18  1:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 12:25 [PATCH] net/sun3_82586: Kill array subscript above array bounds warning Geert Uytterhoeven
2013-07-18  1:22 ` David Miller [this message]
2013-07-18  7:04   ` Geert Uytterhoeven

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=20130717.182237.906875287830581782.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sammy@sammy.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.