• Arnd Bergmann's avatar
    smc91x: avoid self-comparison warning · 5a522473
    Arnd Bergmann authored
    commit e3ebd894 upstream.
    
    The smc91x driver defines a macro that compares its argument to
    itself, apparently to get a true result while using its argument
    to avoid a warning about unused local variables.
    
    Unfortunately, this triggers a warning with gcc-6, as the comparison
    is obviously useless:
    
    drivers/net/ethernet/smsc/smc91x.c: In function 'smc_hardware_send_pkt':
    drivers/net/ethernet/smsc/smc91x.c:563:14: error: self-comparison always evaluates to true [-Werror=tautological-compare]
      if (!smc_special_trylock(&lp->lock, flags)) {
    
    This replaces the macro with another one that behaves similarly,
    with a cast to (void) to ensure the argument is used, and using
    a literal 'true' as its value.
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    5a522473
smc91x.c 63.4 KB