]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.9.135/net-mlx4-use-cpumask_available-for-eq-affinity_mask.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.9.135 / net-mlx4-use-cpumask_available-for-eq-affinity_mask.patch
CommitLineData
be7e94f8
GKH
1From foo@baz Thu Oct 18 11:11:32 CEST 2018
2From: Nathan Chancellor <natechancellor@gmail.com>
3Date: Fri, 21 Sep 2018 02:44:12 -0700
4Subject: net/mlx4: Use cpumask_available for eq->affinity_mask
5
6From: Nathan Chancellor <natechancellor@gmail.com>
7
8[ Upstream commit 8ac1ee6f4d62e781e3b3fd8b9c42b70371427669 ]
9
10Clang warns that the address of a pointer will always evaluated as true
11in a boolean context:
12
13drivers/net/ethernet/mellanox/mlx4/eq.c:243:11: warning: address of
14array 'eq->affinity_mask' will always evaluate to 'true'
15[-Wpointer-bool-conversion]
16 if (!eq->affinity_mask || cpumask_empty(eq->affinity_mask))
17 ~~~~~^~~~~~~~~~~~~
181 warning generated.
19
20Use cpumask_available, introduced in commit f7e30f01a9e2 ("cpumask: Add
21helper cpumask_available()"), which does the proper checking and avoids
22this warning.
23
24Link: https://github.com/ClangBuiltLinux/linux/issues/86
25Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
26Signed-off-by: David S. Miller <davem@davemloft.net>
27Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
28Signed-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);