From: Mohammad abu saleh <ml.abusaleh.ml@gmail.com>
To: netdev@vger.kernel.org
Cc: dsahern@kernel.org, Mohammad abu saleh <ml.abusaleh.ml@gmail.com>
Subject: [PATCH iproute2-next] ip: remove redundant human-readable option match
Date: Wed, 30 Sep 2026 01:55:43 +0200 [thread overview]
Message-ID: <20260929235543.210365-1-ml.abusaleh.ml@gmail.com> (raw)
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
next reply other threads:[~2026-09-29 23:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 23:55 Mohammad abu saleh [this message]
2026-10-02 16:00 ` [PATCH iproute2-next] ip: remove redundant human-readable option match patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260929235543.210365-1-ml.abusaleh.ml@gmail.com \
--to=ml.abusaleh.ml@gmail.com \
--cc=dsahern@kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox