diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-02-23 14:15:32 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-26 17:33:02 +0100 |
commit | ed2da6270ed9ea37d39e9ab597fc5b3b4215ae2a (patch) | |
tree | e94c9ff12e64271f1ddd10feca2ba2f505780b12 /drivers/net/ethernet/sfc/falcon | |
parent | mlxsw: spectrum_kvdl: use div_u64() for 64-bit division (diff) | |
download | linux-ed2da6270ed9ea37d39e9ab597fc5b3b4215ae2a.tar.xz linux-ed2da6270ed9ea37d39e9ab597fc5b3b4215ae2a.zip |
mlxsw: spectrum_kvdl: avoid uninitialized variable warning
gcc warns that 'resource_id' is not initialized if we don't come though
any of the three 'case' statements before:
drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c: In function 'mlxsw_sp_kvdl_part_init':
drivers/net/ethernet/mellanox/mlxsw/spectrum_kvdl.c:275:8: error: 'resource_id' may be used uninitialized in this function [-Werror=maybe-uninitialized]
In the current code, that won't happen, but it's more robust to explicitly
handle this by returning a failure from mlxsw_sp_kvdl_part_init.
Fixes: 887839e6960d ("mlxsw: spectrum_kvdl: Add support for dynamic partition set")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/falcon')
0 files changed, 0 insertions, 0 deletions