]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip: remove duplicate condition in ila_csum_name2mode in
authorAnton Moryakov <ant.v.moryakov@gmail.com>
Mon, 17 Feb 2025 16:21:52 +0000 (19:21 +0300)
committerDavid Ahern <dsahern@kernel.org>
Wed, 19 Feb 2025 15:46:50 +0000 (15:46 +0000)
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.

Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
ip/ila_common.h

index f99c267223d9bcb08991ccd43b0b9336eb668c20..cd3524d5e1cf45466be500dad341ce2f5fd30034 100644 (file)
@@ -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;
 }