ip: remove redundant human-readable option match
Subsystems (2)
PATCH 1/1 ip: remove redundant human-readable option match
matches() checks whether its first argument is a prefix of its second argument. Therefore, matching "-human-readable" already covers "-human" and its abbreviations.
Remove the redundant condition.
Signed-off-by Mohammad abu saleh <[email protected]>
--- ip/ip.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
ip/ip.c +1 -2
@@ -224,8 +224,7 @@ int main(int argc, char **argv) preferred_family =AF_MPLS ; }else if (strcmp (opt,"-B" ) ==0 ) { preferred_family =AF_BRIDGE ; - }else if (matches (opt,"-human" ) ==0 || -matches (opt,"-human-readable" ) ==0 ) { + }else if (matches (opt,"-human-readable" ) ==0 ) { ++human_readable; }else if (matches (opt,"-iec" ) ==0 ) { ++use_iec;
Signature · 1 line
2.53.0
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:
Hello:
This patch was applied to iproute2/iproute2.git (main) by Stephen Hemminger <[email protected]>:
Quoted 9 lines · On Wed, 30 Sep 2026 01:55:43 +0200 you wrote:
matches()checks whether its first argument is a prefix of its second argument. Therefore, matching "-human-readable" already covers "-human" and its abbreviations.Remove the redundant condition.
Signed-off-by Mohammad abu saleh <[email protected]>[...]
Here is the summary with links:
- [iproute2-next] ip: remove redundant human-readable option match
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=a954ab5afd8a
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html