From: Arushi Singhal <arushisinghal19971997@gmail.com>
To: outreachy-kernel@googlegroups.com
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH] iptables: extensions: Remove unnecessary parenthesis.
Date: Thu, 30 Mar 2017 10:43:02 +0530 [thread overview]
Message-ID: <20170330051301.GA25786@arushi-HP-Pavilion-Notebook> (raw)
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
reply other threads:[~2017-03-30 5:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20170330051301.GA25786@arushi-HP-Pavilion-Notebook \
--to=arushisinghal19971997@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=outreachy-kernel@googlegroups.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;
as well as URLs for NNTP newsgroup(s).