Skip to content

Commit 8ac1ee6

Browse files
nathanchancedavem330
authored andcommitted
net/mlx4: Use cpumask_available for eq->affinity_mask
Clang warns that the address of a pointer will always evaluated as true in a boolean context: drivers/net/ethernet/mellanox/mlx4/eq.c:243:11: warning: address of array 'eq->affinity_mask' will always evaluate to 'true' [-Wpointer-bool-conversion] if (!eq->affinity_mask || cpumask_empty(eq->affinity_mask)) ~~~~~^~~~~~~~~~~~~ 1 warning generated. Use cpumask_available, introduced in commit f7e30f0 ("cpumask: Add helper cpumask_available()"), which does the proper checking and avoids this warning. Link: ClangBuiltLinux#86 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 83fe9a9 commit 8ac1ee6

File tree

1 file changed

+2
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx4

1 file changed

+2
-1
lines changed

drivers/net/ethernet/mellanox/mlx4/eq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ static void mlx4_set_eq_affinity_hint(struct mlx4_priv *priv, int vec)
240240
struct mlx4_dev *dev = &priv->dev;
241241
struct mlx4_eq *eq = &priv->eq_table.eq[vec];
242242

243-
if (!eq->affinity_mask || cpumask_empty(eq->affinity_mask))
243+
if (!cpumask_available(eq->affinity_mask) ||
244+
cpumask_empty(eq->affinity_mask))
244245
return;
245246

246247
hint_err = irq_set_affinity_hint(eq->irq, eq->affinity_mask);

0 commit comments

Comments
 (0)