Thread (6 messages) flat view 6 messages, 3 authors, 2018-02-26

Re: [net-next PATCH 2/2] mlxsw: spectrum_kvdl: avoid uninitialized variable warning

From: David Miller <davem@davemloft.net>
Date: 2018-02-26 16:33:33
Also in: lkml

From: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 23 Feb 2018 14:15:32 +0100
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>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help