netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iptables: extensions: Remove unnecessary parenthesis.
@ 2017-03-30  5:13 Arushi Singhal
  0 siblings, 0 replies; only message in thread
From: Arushi Singhal @ 2017-03-30  5:13 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: netfilter-devel

Removed parenthesis on the right hand side of assignment, as they are
not required.
The following coccinelle script was used to fix this issue:

@@
local idexpression id;
expression e;
@@

id =
-(
e
-)

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 extensions/libebt_mark.c  | 8 ++++----
 extensions/libxt_string.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/extensions/libebt_mark.c b/extensions/libebt_mark.c
index 7b80b22..d85ed8d 100644
--- a/extensions/libebt_mark.c
+++ b/extensions/libebt_mark.c
@@ -86,7 +86,7 @@ brmark_parse(int c, char **argv, int invert, unsigned int *flags,
 		return 1;
 	case MARK_SETMARK:
 		EBT_CHECK_OPTION(flags, OPT_MARK_SETMARK);
-		mask = (OPT_MARK_ORMARK|OPT_MARK_ANDMARK|OPT_MARK_XORMARK);
+		mask = OPT_MARK_ORMARK|OPT_MARK_ANDMARK|OPT_MARK_XORMARK;
 		if (*flags & mask)
 			xtables_error(PARAMETER_PROBLEM,
 				      "--mark-set cannot be used together with"
@@ -96,7 +96,7 @@ brmark_parse(int c, char **argv, int invert, unsigned int *flags,
 		break;
 	case MARK_ORMARK:
 		EBT_CHECK_OPTION(flags, OPT_MARK_ORMARK);
-		mask = (OPT_MARK_SETMARK|OPT_MARK_ANDMARK|OPT_MARK_XORMARK);
+		mask = OPT_MARK_SETMARK|OPT_MARK_ANDMARK|OPT_MARK_XORMARK;
 		if (*flags & mask)
 			xtables_error(PARAMETER_PROBLEM,
 				      "--mark-or cannot be used together with"
@@ -106,7 +106,7 @@ brmark_parse(int c, char **argv, int invert, unsigned int *flags,
 		break;
 	case MARK_ANDMARK:
 		EBT_CHECK_OPTION(flags, OPT_MARK_ANDMARK);
-		mask = (OPT_MARK_SETMARK|OPT_MARK_ORMARK|OPT_MARK_XORMARK);
+		mask = OPT_MARK_SETMARK|OPT_MARK_ORMARK|OPT_MARK_XORMARK;
 		if (*flags & mask)
 			xtables_error(PARAMETER_PROBLEM,
 				      "--mark-and cannot be used together with"
@@ -116,7 +116,7 @@ brmark_parse(int c, char **argv, int invert, unsigned int *flags,
 		break;
 	case MARK_XORMARK:
 		EBT_CHECK_OPTION(flags, OPT_MARK_XORMARK);
-		mask = (OPT_MARK_SETMARK|OPT_MARK_ANDMARK|OPT_MARK_ORMARK);
+		mask = OPT_MARK_SETMARK|OPT_MARK_ANDMARK|OPT_MARK_ORMARK;
 		if (*flags & mask)
 			xtables_error(PARAMETER_PROBLEM,
 				      "--mark-xor cannot be used together with"
diff --git a/extensions/libxt_string.c b/extensions/libxt_string.c
index fb15980..535e63b 100644
--- a/extensions/libxt_string.c
+++ b/extensions/libxt_string.c
@@ -255,8 +255,8 @@ string_print(const void *ip, const struct xt_entry_match *match, int numeric)
 	const struct xt_string_info *info =
 	    (const struct xt_string_info*) match->data;
 	const int revision = match->u.user.revision;
-	int invert = (revision == 0 ? info->u.v0.invert :
-				    info->u.v1.flags & XT_STRING_FLAG_INVERT);
+	int invert = revision == 0 ? info->u.v0.invert :
+				    info->u.v1.flags & XT_STRING_FLAG_INVERT;
 
 	if (is_hex_string(info->pattern, info->patlen)) {
 		printf(" STRING match %s", invert ? "!" : "");
@@ -279,8 +279,8 @@ static void string_save(const void *ip, const struct xt_entry_match *match)
 	const struct xt_string_info *info =
 	    (const struct xt_string_info*) match->data;
 	const int revision = match->u.user.revision;
-	int invert = (revision == 0 ? info->u.v0.invert :
-				    info->u.v1.flags & XT_STRING_FLAG_INVERT);
+	int invert = revision == 0 ? info->u.v0.invert :
+				    info->u.v1.flags & XT_STRING_FLAG_INVERT;
 
 	if (is_hex_string(info->pattern, info->patlen)) {
 		printf("%s --hex-string", (invert) ? " !" : "");
-- 
2.11.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-30  5:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-30  5:13 [PATCH] iptables: extensions: Remove unnecessary parenthesis Arushi Singhal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).