Netdev List
 help / color / mirror / Atom feed
* [PATCH iproute2-next] ip: remove redundant human-readable option match
@ 2026-09-29 23:55 Mohammad abu saleh
  2026-10-02 16:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Mohammad abu saleh @ 2026-09-29 23:55 UTC (permalink / raw)
  To: netdev; +Cc: dsahern, Mohammad abu saleh

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 <ml.abusaleh.ml@gmail.com>
---
 ip/ip.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ip/ip.c b/ip/ip.c
index e4b71bde..dd84f94b 100644
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -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;
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH iproute2-next] ip: remove redundant human-readable option match
  2026-09-29 23:55 [PATCH iproute2-next] ip: remove redundant human-readable option match Mohammad abu saleh
@ 2026-10-02 16:00 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-10-02 16:00 UTC (permalink / raw)
  To: Mohammad abu saleh; +Cc: netdev, dsahern

Hello:

This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:

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 <ml.abusaleh.ml@gmail.com>
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-02 16:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-29 23:55 [PATCH iproute2-next] ip: remove redundant human-readable option match Mohammad abu saleh
2026-10-02 16:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox