Skip to contentSkip to conversation

ip: remove duplicate condition in ila_csum_name2mode in

PATCH New Anton Moryakov 1 participant 1 message Feb 16, 2025

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

PATCH 1/1 ip: remove duplicate condition in ila_csum_name2mode in

Static analyzer reported:
expression is identical to previous conditio

Corrections explained:
The condition checking for "neutral-map-auto" was duplicated in the ila_csum_name2mode function. This commit removes the redundant check to improve code readability and maintainability.

Triggers found by static analyzer Svace.

---
 ip/ila_common.h | 2 --
 1 file changed, 2 deletions(-)
ip/ila_common.h +0 -2
index f99c2672..cd3524d5 100644
@@ -31,8 +31,6 @@ static inline int ila_csum_name2mode(char *name)
 		return ILA_CSUM_NEUTRAL_MAP_AUTO;
 	else if (strcmp(name, "no-action") == 0)
 		return ILA_CSUM_NO_ACTION;
-	else if (strcmp(name, "neutral-map-auto") == 0)
-		return ILA_CSUM_NEUTRAL_MAP_AUTO;
 	else
 		return -1;
 }
Signature · 1 line
2.30.2