• Jakub Kicinski's avatar
    eth: tg3: silence the GCC 12 array-bounds warning · 9dec850f
    Jakub Kicinski authored
    GCC 12 currently generates a rather inconsistent warning:
    
    drivers/net/ethernet/broadcom/tg3.c:17795:51: warning: array subscript 5 is above array bounds of ‘struct tg3_napi[5]’ [-Warray-bounds]
    17795 |                 struct tg3_napi *tnapi = &tp->napi[i];
          |                                           ~~~~~~~~^~~
    
    i is guaranteed < tp->irq_max which in turn is either 1 or 5.
    There are more loops like this one in the driver, but strangely
    GCC 12 dislikes only this single one.
    
    Silence this silliness for now.
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    9dec850f
Makefile 738 Bytes