• Ben Dooks's avatar
    net: macb: fixup sparse warnings on __be16 ports · 6ee49d62
    Ben Dooks authored
    The port fields in the ethool flow structures are defined
    to be __be16 types, so sparse is showing issues where these
    are being passed to htons(). Fix these warnings by passing
    them to be16_to_cpu() instead.
    
    These are being used in netdev_dbg() so should only effect
    anyone doing debug.
    
    Fixes the following sparse warnings:
    
    drivers/net/ethernet/cadence/macb_main.c:3366:9: warning: cast from restricted __be16
    drivers/net/ethernet/cadence/macb_main.c:3366:9: warning: cast from restricted __be16
    drivers/net/ethernet/cadence/macb_main.c:3366:9: warning: cast from restricted __be16
    drivers/net/ethernet/cadence/macb_main.c:3419:25: warning: cast from restricted __be16
    drivers/net/ethernet/cadence/macb_main.c:3419:25: warning: cast from restricted __be16
    drivers/net/ethernet/cadence/macb_main.c:3419:25: warning: cast from restricted __be16
    drivers/net/ethernet/cadence/macb_main.c:3419:25: warning: cast from restricted __be16
    Signed-off-by: default avatarBen Dooks <ben.dooks@sifive.com>
    Link: https://lore.kernel.org/r/20220715173009.526126-1-ben.dooks@sifive.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    6ee49d62
macb_main.c 135 KB