Skip to contentSkip to conversation

net: mvpp2: cls: Remove unnecessary comparison of unsigned integer with < 0

PATCH New Gustavo A. R. Silva 1 participant 1 message May 27, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: mvpp2: cls: Remove unnecessary comparison of unsigned integer with < 0

There is no need to compare info->fs.location with < 0 because such comparison of an unsigned value is always false.

Fix this by removing such comparison.

Addresses-Coverity-ID: 1445598 ("Unsigned compared against 0")

---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c +1 -2
index d046f7a1dcf5..40beeb72ae10 100644
@@ -1232,8 +1232,7 @@ int mvpp2_ethtool_cls_rule_ins(struct mvpp2_port *port,
 	struct mvpp2_ethtool_fs *efs, *old_efs;
 	int ret = 0;
 
-	if (info->fs.location >= 4 ||
-	    info->fs.location < 0)
+	if (info->fs.location >= 4)
 		return -EINVAL;
 
 	efs = kzalloc(sizeof(*efs), GFP_KERNEL);
Signature · 1 line
2.21.0