[patch net-next] spectrum: acl_tcam: Fix catchall prio value

Subsystems: mellanox ethernet switch drivers, networking drivers, the rest

STALE3499d REVIEWED: 1 (0M)

1 review trailer.

2 messages, 2 authors, 2017-02-07 · open the first message on its own page

[patch net-next] spectrum: acl_tcam: Fix catchall prio value

From: Jiri Pirko <jiri@resnulli.us>
Date: 2017-02-07 14:27:27

From: Jiri Pirko <redacted>

This fixes an issue reported by smatch:
mlxsw_sp_acl_tcam_chunk_create() warn: impossible condition '(priority == (-1)) => (0-u32max == u64max)'

Reported-by: Or Gerlitz <redacted>
Reported-by: Ido Schimmel <redacted>
Reported-by: Dan Carpenter <redacted>
Fixes: 22a677661f56 ("mlxsw: spectrum: Introduce ACL core with simple TCAM implementation")
Signed-off-by: Jiri Pirko <redacted>
Acked-by: Ido Schimmel <redacted>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
index a0a968e..1ec3dd0 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
@@ -561,7 +561,7 @@ mlxsw_sp_acl_tcam_region_entry_remove(struct mlxsw_sp *mlxsw_sp,
 	mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl);
 }
 
-#define MLXSW_SP_ACL_TCAM_CATCHALL_PRIO (-1UL)
+#define MLXSW_SP_ACL_TCAM_CATCHALL_PRIO (-1U)
 
 static int
 mlxsw_sp_acl_tcam_region_catchall_add(struct mlxsw_sp *mlxsw_sp,
-- 
2.7.4

RE: [patch net-next] spectrum: acl_tcam: Fix catchall prio value

From: David Laight <hidden>
Date: 2017-02-07 14:34:05

From: Jiri Pirko
Sent: 07 February 2017 14:27
From: Jiri Pirko <redacted>

This fixes an issue reported by smatch:
mlxsw_sp_acl_tcam_chunk_create() warn: impossible condition '(priority == (-1)) => (0-u32max ==
u64max)'
...
quoted hunk
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
index a0a968e..1ec3dd0 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c
@@ -561,7 +561,7 @@ mlxsw_sp_acl_tcam_region_entry_remove(struct mlxsw_sp *mlxsw_sp,
 	mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl);
 }

-#define MLXSW_SP_ACL_TCAM_CATCHALL_PRIO (-1UL)
+#define MLXSW_SP_ACL_TCAM_CATCHALL_PRIO (-1U)
Either (-1) or (~0u) is probably better.

	David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help