[PATCH 1/4] net: mvpp2: Fix impossible test

Andrew Goodbody andrew.goodbody at linaro.org
Tue Aug 5 16:18:16 CEST 2025


You cannot test an unsigned char to be >= 256. Instead make the
variables start and end to be ints.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>
---
 drivers/net/mvpp2.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/mvpp2.c b/drivers/net/mvpp2.c
index 184c1f9a46a..c0328345973 100644
--- a/drivers/net/mvpp2.c
+++ b/drivers/net/mvpp2.c
@@ -1722,8 +1722,7 @@ static struct mvpp2_prs_entry *mvpp2_prs_flow_find(struct mvpp2 *priv, int flow)
 }
 
 /* Return first free tcam index, seeking from start to end */
-static int mvpp2_prs_tcam_first_free(struct mvpp2 *priv, unsigned char start,
-				     unsigned char end)
+static int mvpp2_prs_tcam_first_free(struct mvpp2 *priv, int start, int end)
 {
 	int tid;
 

-- 
2.39.5



More information about the U-Boot mailing list