]> git.baikalelectronics.ru Git - kernel.git/commit
enic: fix build warning without CONFIG_CPUMASK_OFFSTACK
authorArnd Bergmann <arnd@arndb.de>
Thu, 7 Mar 2019 15:52:24 +0000 (16:52 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Mar 2019 17:41:08 +0000 (09:41 -0800)
commit4cd6f506c8f8f82008924920d2c6a54f0d97a35a
treeff44e8cfeb3b8ded5c88563fc6675ec3d66f3826
parent65c4566e8dcdcb5862f218d4c83617ddc90088ab
enic: fix build warning without CONFIG_CPUMASK_OFFSTACK

The enic driver relies on the CONFIG_CPUMASK_OFFSTACK feature to
dynamically allocate a struct member, but this is normally intended for
local variables.

Building with clang, I get a warning for a few locations that check the
address of the cpumask_var_t:

drivers/net/ethernet/cisco/enic/enic_main.c:122:22: error: address of array 'enic->msix[i].affinity_mask' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]

As far as I can tell, the code is still correct, as the truth value of
the pointer is what we need in this configuration. To get rid of
the warning, use cpumask_available() instead of checking the
pointer directly.

Fixes: d09d0b936d49 ("enic: assign affinity hint to interrupts")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cisco/enic/enic_main.c