]>
Commit | Line | Data |
---|---|---|
be7e94f8 GKH |
1 | From foo@baz Thu Oct 18 11:11:32 CEST 2018 |
2 | From: Nathan Chancellor <natechancellor@gmail.com> | |
3 | Date: Fri, 21 Sep 2018 02:44:12 -0700 | |
4 | Subject: net/mlx4: Use cpumask_available for eq->affinity_mask | |
5 | ||
6 | From: Nathan Chancellor <natechancellor@gmail.com> | |
7 | ||
8 | [ Upstream commit 8ac1ee6f4d62e781e3b3fd8b9c42b70371427669 ] | |
9 | ||
10 | Clang warns that the address of a pointer will always evaluated as true | |
11 | in a boolean context: | |
12 | ||
13 | drivers/net/ethernet/mellanox/mlx4/eq.c:243:11: warning: address of | |
14 | array 'eq->affinity_mask' will always evaluate to 'true' | |
15 | [-Wpointer-bool-conversion] | |
16 | if (!eq->affinity_mask || cpumask_empty(eq->affinity_mask)) | |
17 | ~~~~~^~~~~~~~~~~~~ | |
18 | 1 warning generated. | |
19 | ||
20 | Use cpumask_available, introduced in commit f7e30f01a9e2 ("cpumask: Add | |
21 | helper cpumask_available()"), which does the proper checking and avoids | |
22 | this warning. | |
23 | ||
24 | Link: https://github.com/ClangBuiltLinux/linux/issues/86 | |
25 | Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> | |
26 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
27 | Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> | |
28 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
29 | --- | |
30 | drivers/net/ethernet/mellanox/mlx4/eq.c | 3 ++- | |
31 | 1 file changed, 2 insertions(+), 1 deletion(-) | |
32 | ||
33 | --- a/drivers/net/ethernet/mellanox/mlx4/eq.c | |
34 | +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c | |
35 | @@ -240,7 +240,8 @@ static void mlx4_set_eq_affinity_hint(st | |
36 | struct mlx4_dev *dev = &priv->dev; | |
37 | struct mlx4_eq *eq = &priv->eq_table.eq[vec]; | |
38 | ||
39 | - if (!eq->affinity_mask || cpumask_empty(eq->affinity_mask)) | |
40 | + if (!cpumask_available(eq->affinity_mask) || | |
41 | + cpumask_empty(eq->affinity_mask)) | |
42 | return; | |
43 | ||
44 | hint_err = irq_set_affinity_hint(eq->irq, eq->affinity_mask); |