[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1465558928-19657-7-git-send-email-phil@nwl.cc>
Date: Fri, 10 Jun 2016 13:42:05 +0200
From: Phil Sutter <phil@....cc>
To: Stephen Hemminger <shemming@...cade.com>
Cc: netdev@...r.kernel.org
Subject: [iproute PATCH 6/9] tc: m_xt: Get rid of rargc in parse_ipt()
No need to copy the passed parameter, it's changed only once right
before function return.
Signed-off-by: Phil Sutter <phil@....cc>
---
tc/m_xt.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/tc/m_xt.c b/tc/m_xt.c
index c42f3bda4e8f4..61fc437dfc907 100644
--- a/tc/m_xt.c
+++ b/tc/m_xt.c
@@ -123,7 +123,6 @@ static int parse_ipt(struct action_util *a, int *argc_p,
struct rtattr *tail;
int c;
- int rargc = *argc_p;
char **argv = *argv_p;
int argc = 0, iargc = 0;
char k[16];
@@ -140,7 +139,7 @@ static int parse_ipt(struct action_util *a, int *argc_p,
{
int i;
- for (i = 0; i < rargc; i++) {
+ for (i = 0; i < *argc_p; i++) {
if (NULL == argv[i] || 0 == strcmp(argv[i], "action")) {
break;
}
@@ -149,7 +148,7 @@ static int parse_ipt(struct action_util *a, int *argc_p,
}
if (argc <= 2) {
- fprintf(stderr, "bad arguments to ipt %d vs %d\n", argc, rargc);
+ fprintf(stderr, "bad arguments to ipt %d vs %d\n", argc, *argc_p);
return -1;
}
@@ -274,7 +273,7 @@ static int parse_ipt(struct action_util *a, int *argc_p,
argc -= optind;
argv += optind;
- *argc_p = rargc - iargc;
+ *argc_p -= iargc;
*argv_p = argv;
optind = 0;
--
2.8.2
Powered by blists - more mailing lists