diff mbox

[2/2] iptables: Remove unnecessary braces.

Message ID 58dc0ab2.15dc630a.414de.570e@mx.google.com
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Varsha Rao March 29, 2017, 7:27 p.m. UTC
Remove braces which are not required, to fix the check patch issue.
The following coccinelle script was used to fix this issue.

@@
expression e;
expression e1;
@@
if(e)
-{
 e1;
-}

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
---
 iptables/iptables-standalone.c | 3 +--
 iptables/iptables.c            | 3 +--
 iptables/xtables-standalone.c  | 3 +--
 iptables/xtables-translate.c   | 6 ++----
 4 files changed, 5 insertions(+), 10 deletions(-)

Comments

Pablo Neira Ayuso April 6, 2017, 4:22 p.m. UTC | #1
On Thu, Mar 30, 2017 at 12:57:43AM +0530, Varsha Rao wrote:
> Remove braces which are not required, to fix the check patch issue.
> The following coccinelle script was used to fix this issue.
> 
> @@
> expression e;
> expression e1;
> @@
> if(e)
> -{
>  e1;
> -}

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/iptables/iptables-standalone.c b/iptables/iptables-standalone.c
index 4da1d7f..c211fb7 100644
--- a/iptables/iptables-standalone.c
+++ b/iptables/iptables-standalone.c
@@ -73,9 +73,8 @@  iptables_main(int argc, char *argv[])
 			fprintf(stderr, "iptables: %s.\n",
 				iptc_strerror(errno));
 		}
-		if (errno == EAGAIN) {
+		if (errno == EAGAIN)
 			exit(RESOURCE_PROBLEM);
-		}
 	}
 
 	exit(!ret);
diff --git a/iptables/iptables.c b/iptables/iptables.c
index 62731c5..97cbda9 100644
--- a/iptables/iptables.c
+++ b/iptables/iptables.c
@@ -1114,9 +1114,8 @@  void print_rule4(const struct ipt_entry *e,
 		       e->ip.invflags & IPT_INV_FRAG ? " !" : "");
 
 	/* Print matchinfo part */
-	if (e->target_offset) {
+	if (e->target_offset)
 		IPT_MATCH_ITERATE(e, print_match_save, &e->ip);
-	}
 
 	/* print counters for iptables -R */
 	if (counters < 0)
diff --git a/iptables/xtables-standalone.c b/iptables/xtables-standalone.c
index 355a446..139c477 100644
--- a/iptables/xtables-standalone.c
+++ b/iptables/xtables-standalone.c
@@ -85,9 +85,8 @@  xtables_main(int family, const char *progname, int argc, char *argv[])
 			fprintf(stderr, "iptables: %s.\n",
 				nft_strerror(errno));
 		}
-		if (errno == EAGAIN) {
+		if (errno == EAGAIN)
 			exit(RESOURCE_PROBLEM);
-		}
 	}
 
 	exit(!ret);
diff --git a/iptables/xtables-translate.c b/iptables/xtables-translate.c
index 00de019..e049f24 100644
--- a/iptables/xtables-translate.c
+++ b/iptables/xtables-translate.c
@@ -236,9 +236,8 @@  static int do_command_xlate(struct nft_handle *h, int argc, char *argv[],
 	switch (p.command) {
 	case CMD_APPEND:
 		ret = 1;
-		if (!xlate(h, &p, &cs, &args, true, nft_rule_xlate_add)) {
+		if (!xlate(h, &p, &cs, &args, true, nft_rule_xlate_add))
 			print_ipt_cmd(argc, argv);
-		}
 		break;
 	case CMD_DELETE:
 		break;
@@ -250,9 +249,8 @@  static int do_command_xlate(struct nft_handle *h, int argc, char *argv[],
 		break;
 	case CMD_INSERT:
 		ret = 1;
-		if (!xlate(h, &p, &cs, &args, false, nft_rule_xlate_add)) {
+		if (!xlate(h, &p, &cs, &args, false, nft_rule_xlate_add))
 			print_ipt_cmd(argc, argv);
-		}
 		break;
 	case CMD_FLUSH:
 		if (p.chain) {