• David S. Miller's avatar
    mv88e6xxx: Fix uninitialized variable warning. · 7ddae24f
    David S. Miller authored
    In mv88e6xxx_probe(), ("np" or "pdata") might be an invariant
    but GCC can't see that, therefore:
    
    drivers/net/dsa/mv88e6xxx/chip.c: In function ‘mv88e6xxx_probe’:
    drivers/net/dsa/mv88e6xxx/chip.c:4420:13: warning: ‘compat_info’ may be used uninitialized in this function [-Wmaybe-uninitialized]
      chip->info = compat_info;
    
    Actually, it should have warned on the "if (!compat_info)" test, but
    whatever.
    
    Explicitly initialize to NULL in the variable declaration to
    deal with this.
    
    Fixes: 877b7cb0 ("net: dsa: mv88e6xxx: Add minimal platform_data support")
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    7ddae24f
chip.c 127 KB