From: Phil Sutter <phil@nwl.cc>
To: Stephen Hemminger <shemming@brocade.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>, netdev@vger.kernel.org
Subject: [iproute PATCH 1/4] tc/p_ip.c: Lint through checkpatch.pl
Date: Wed, 16 Mar 2016 22:48:32 +0100 [thread overview]
Message-ID: <1458164915-31802-2-git-send-email-phil@nwl.cc> (raw)
In-Reply-To: <1458164915-31802-1-git-send-email-phil@nwl.cc>
This diff was generated by using the fix-inplace option of checkpatch.pl
and breaking the overlong lines of parse_ip() and parse_ip6()
signatures.
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
tc/p_ip.c | 38 ++++++++++++++++++++------------------
1 file changed, 20 insertions(+), 18 deletions(-)
diff --git a/tc/p_ip.c b/tc/p_ip.c
index 10e4bebc71d94..535151e5d7668 100644
--- a/tc/p_ip.c
+++ b/tc/p_ip.c
@@ -24,7 +24,8 @@
#include "m_pedit.h"
static int
-parse_ip(int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey)
+parse_ip(int *argc_p, char ***argv_p,
+ struct tc_pedit_sel *sel, struct tc_pedit_key *tkey)
{
int res = -1;
int argc = *argc_p;
@@ -36,13 +37,13 @@ parse_ip(int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_ke
if (strcmp(*argv, "src") == 0) {
NEXT_ARG();
tkey->off = 12;
- res = parse_cmd(&argc, &argv, 4, TIPV4,RU32,sel,tkey);
+ res = parse_cmd(&argc, &argv, 4, TIPV4, RU32, sel, tkey);
goto done;
}
if (strcmp(*argv, "dst") == 0) {
NEXT_ARG();
tkey->off = 16;
- res = parse_cmd(&argc, &argv, 4, TIPV4,RU32,sel,tkey);
+ res = parse_cmd(&argc, &argv, 4, TIPV4, RU32, sel, tkey);
goto done;
}
/* jamal - look at these and make them either old or new
@@ -52,94 +53,95 @@ parse_ip(int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_ke
if (strcmp(*argv, "tos") == 0 || matches(*argv, "dsfield") == 0) {
NEXT_ARG();
tkey->off = 1;
- res = parse_cmd(&argc, &argv, 1, TU32,RU8,sel,tkey);
+ res = parse_cmd(&argc, &argv, 1, TU32, RU8, sel, tkey);
goto done;
}
if (strcmp(*argv, "ihl") == 0) {
NEXT_ARG();
tkey->off = 0;
- res = parse_cmd(&argc, &argv, 1, TU32,0x0f,sel,tkey);
+ res = parse_cmd(&argc, &argv, 1, TU32, 0x0f, sel, tkey);
goto done;
}
if (strcmp(*argv, "protocol") == 0) {
NEXT_ARG();
tkey->off = 9;
- res = parse_cmd(&argc, &argv, 1, TU32,RU8,sel,tkey);
+ res = parse_cmd(&argc, &argv, 1, TU32, RU8, sel, tkey);
goto done;
}
/* jamal - fix this */
if (matches(*argv, "precedence") == 0) {
NEXT_ARG();
tkey->off = 1;
- res = parse_cmd(&argc, &argv, 1, TU32,RU8,sel,tkey);
+ res = parse_cmd(&argc, &argv, 1, TU32, RU8, sel, tkey);
goto done;
}
/* jamal - validate this at some point */
if (strcmp(*argv, "nofrag") == 0) {
NEXT_ARG();
tkey->off = 6;
- res = parse_cmd(&argc, &argv, 1, TU32,0x3F,sel,tkey);
+ res = parse_cmd(&argc, &argv, 1, TU32, 0x3F, sel, tkey);
goto done;
}
/* jamal - validate this at some point */
if (strcmp(*argv, "firstfrag") == 0) {
NEXT_ARG();
tkey->off = 6;
- res = parse_cmd(&argc, &argv, 1, TU32,0x1F,sel,tkey);
+ res = parse_cmd(&argc, &argv, 1, TU32, 0x1F, sel, tkey);
goto done;
}
if (strcmp(*argv, "ce") == 0) {
NEXT_ARG();
tkey->off = 6;
- res = parse_cmd(&argc, &argv, 1, TU32,0x80,sel,tkey);
+ res = parse_cmd(&argc, &argv, 1, TU32, 0x80, sel, tkey);
goto done;
}
if (strcmp(*argv, "df") == 0) {
NEXT_ARG();
tkey->off = 6;
- res = parse_cmd(&argc, &argv, 1, TU32,0x40,sel,tkey);
+ res = parse_cmd(&argc, &argv, 1, TU32, 0x40, sel, tkey);
goto done;
}
if (strcmp(*argv, "mf") == 0) {
NEXT_ARG();
tkey->off = 6;
- res = parse_cmd(&argc, &argv, 1, TU32,0x20,sel,tkey);
+ res = parse_cmd(&argc, &argv, 1, TU32, 0x20, sel, tkey);
goto done;
}
if (strcmp(*argv, "dport") == 0) {
NEXT_ARG();
tkey->off = 22;
- res = parse_cmd(&argc, &argv, 2, TU32,RU16,sel,tkey);
+ res = parse_cmd(&argc, &argv, 2, TU32, RU16, sel, tkey);
goto done;
}
if (strcmp(*argv, "sport") == 0) {
NEXT_ARG();
tkey->off = 20;
- res = parse_cmd(&argc, &argv, 2, TU32,RU16,sel,tkey);
+ res = parse_cmd(&argc, &argv, 2, TU32, RU16, sel, tkey);
goto done;
}
if (strcmp(*argv, "icmp_type") == 0) {
NEXT_ARG();
tkey->off = 20;
- res = parse_cmd(&argc, &argv, 1, TU32,RU8,sel,tkey);
+ res = parse_cmd(&argc, &argv, 1, TU32, RU8, sel, tkey);
goto done;
}
if (strcmp(*argv, "icmp_code") == 0) {
NEXT_ARG();
tkey->off = 20;
- res = parse_cmd(&argc, &argv, 1, TU32,RU8,sel,tkey);
+ res = parse_cmd(&argc, &argv, 1, TU32, RU8, sel, tkey);
goto done;
}
return -1;
- done:
+done:
*argc_p = argc;
*argv_p = argv;
return res;
}
static int
-parse_ip6(int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey)
+parse_ip6(int *argc_p, char ***argv_p,
+ struct tc_pedit_sel *sel, struct tc_pedit_key *tkey)
{
int res = -1;
return res;
--
2.7.2
next prev parent reply other threads:[~2016-03-16 21:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-16 21:48 [iproute PATCH 0/4] tc: pedit: further fixes Phil Sutter
2016-03-16 21:48 ` Phil Sutter [this message]
2016-03-16 21:48 ` [iproute PATCH 2/4] tc: pedit: Fix for big-endian systems Phil Sutter
2016-03-16 21:48 ` [iproute PATCH 3/4] tc: pedit: Fix raw op Phil Sutter
2016-03-16 21:48 ` [iproute PATCH 4/4] testsuite: add a test for tc pedit action Phil Sutter
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=1458164915-31802-2-git-send-email-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=jhs@mojatatu.com \
--cc=netdev@vger.kernel.org \
--cc=shemming@brocade.com \
/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