lkml.org 
[lkml]   [2013]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net/sun3_82586: Kill array subscript above array bounds warning
From
On Thu, Jul 18, 2013 at 3:22 AM, David Miller <davem@davemloft.net> wrote:
>> 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.

Yeah, this driver could use some major cleanup. I had to protect my eyes while
fixing the compiler warning.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


\
 
 \ /
  Last update: 2013-07-18 09:41    [W:0.038 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site