[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200228214243.27344-2-stephen@networkplumber.org>
Date: Fri, 28 Feb 2020 13:42:43 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: netdev@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute2 2/2] ss: indentation in ssfilter
Indent switch statement like kernel.
Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
---
misc/ss.c | 46 ++++++++++++++++++++++------------------------
1 file changed, 22 insertions(+), 24 deletions(-)
diff --git a/misc/ss.c b/misc/ss.c
index b478ab47da4e..40b55d8bdd82 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -1806,15 +1806,14 @@ static void ssfilter_patch(char *a, int len, int reloc)
static int ssfilter_bytecompile(struct ssfilter *f, char **bytecode)
{
switch (f->type) {
- case SSF_S_AUTO:
- {
+ case SSF_S_AUTO: {
if (!(*bytecode = malloc(4))) abort();
((struct inet_diag_bc_op *)*bytecode)[0] = (struct inet_diag_bc_op){ INET_DIAG_BC_AUTO, 4, 8 };
return 4;
}
- case SSF_DCOND:
- case SSF_SCOND:
- {
+
+ case SSF_DCOND:
+ case SSF_SCOND: {
struct aafilter *a = (void *)f->pred;
struct aafilter *b;
char *ptr;
@@ -1852,8 +1851,8 @@ static int ssfilter_bytecompile(struct ssfilter *f, char **bytecode)
}
return ptr - *bytecode;
}
- case SSF_D_GE:
- {
+
+ case SSF_D_GE: {
struct aafilter *x = (void *)f->pred;
if (!(*bytecode = malloc(8))) abort();
@@ -1861,8 +1860,8 @@ static int ssfilter_bytecompile(struct ssfilter *f, char **bytecode)
((struct inet_diag_bc_op *)*bytecode)[1] = (struct inet_diag_bc_op){ 0, 0, x->port };
return 8;
}
- case SSF_D_LE:
- {
+
+ case SSF_D_LE: {
struct aafilter *x = (void *)f->pred;
if (!(*bytecode = malloc(8))) abort();
@@ -1870,8 +1869,8 @@ static int ssfilter_bytecompile(struct ssfilter *f, char **bytecode)
((struct inet_diag_bc_op *)*bytecode)[1] = (struct inet_diag_bc_op){ 0, 0, x->port };
return 8;
}
- case SSF_S_GE:
- {
+
+ case SSF_S_GE: {
struct aafilter *x = (void *)f->pred;
if (!(*bytecode = malloc(8))) abort();
@@ -1879,8 +1878,7 @@ static int ssfilter_bytecompile(struct ssfilter *f, char **bytecode)
((struct inet_diag_bc_op *)*bytecode)[1] = (struct inet_diag_bc_op){ 0, 0, x->port };
return 8;
}
- case SSF_S_LE:
- {
+ case SSF_S_LE: {
struct aafilter *x = (void *)f->pred;
if (!(*bytecode = malloc(8))) abort();
@@ -1889,8 +1887,7 @@ static int ssfilter_bytecompile(struct ssfilter *f, char **bytecode)
return 8;
}
- case SSF_AND:
- {
+ case SSF_AND: {
char *a1 = NULL, *a2 = NULL, *a;
int l1, l2;
@@ -1909,8 +1906,8 @@ static int ssfilter_bytecompile(struct ssfilter *f, char **bytecode)
*bytecode = a;
return l1+l2;
}
- case SSF_OR:
- {
+
+ case SSF_OR: {
char *a1 = NULL, *a2 = NULL, *a;
int l1, l2;
@@ -1929,8 +1926,8 @@ static int ssfilter_bytecompile(struct ssfilter *f, char **bytecode)
*bytecode = a;
return l1+l2+4;
}
- case SSF_NOT:
- {
+
+ case SSF_NOT: {
char *a1 = NULL, *a;
int l1;
@@ -1946,13 +1943,13 @@ static int ssfilter_bytecompile(struct ssfilter *f, char **bytecode)
*bytecode = a;
return l1+4;
}
- case SSF_DEVCOND:
- {
+
+ case SSF_DEVCOND: {
/* bytecompile for SSF_DEVCOND not supported yet */
return 0;
}
- case SSF_MARKMASK:
- {
+
+ case SSF_MARKMASK: {
struct aafilter *a = (void *)f->pred;
struct instr {
struct inet_diag_bc_op op;
@@ -1968,7 +1965,8 @@ static int ssfilter_bytecompile(struct ssfilter *f, char **bytecode)
return inslen;
}
- default:
+
+ default:
abort();
}
}
--
2.20.1
Powered by blists - more mailing lists