Message ID | 1429954020-11763-4-git-send-email-ipm@chirality.org.uk |
---|---|
State | Awaiting Upstream, archived |
Delegated to: | David Miller |
Headers | show |
On Sat, 2015-04-25 at 10:26 +0100, Ian Morris wrote: > Remove braces from a few if statements where not required. trivia: > diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c [] > @@ -151,9 +151,8 @@ ip6_packet_match(const struct sk_buff *skb, > ip6info->proto); > > if (ip6info->proto == protohdr) { > - if (ip6info->invflags & IP6T_INV_PROTO) { > + if (ip6info->invflags & IP6T_INV_PROTO) > return false; > - } > return true; maybe return (!(ip6info->invflags & IP6T_INV_PROTO)); -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hello. On 04/25/2015 06:59 PM, Joe Perches wrote: >> Remove braces from a few if statements where not required. > trivia: >> diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c > [] >> @@ -151,9 +151,8 @@ ip6_packet_match(const struct sk_buff *skb, >> ip6info->proto); >> >> if (ip6info->proto == protohdr) { >> - if (ip6info->invflags & IP6T_INV_PROTO) { >> + if (ip6info->invflags & IP6T_INV_PROTO) >> return false; >> - } >> return true; > maybe > return (!(ip6info->invflags & IP6T_INV_PROTO)); Parens around the *return* expression are not necessary. :-) WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Sat, 2015-04-25 at 19:54 +0300, Sergei Shtylyov wrote:
> Parens around the *return* expression are not necessary. :-)
Yeah, what Sergei said...
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 82d53d5..1f8a503 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c @@ -151,9 +151,8 @@ ip6_packet_match(const struct sk_buff *skb, ip6info->proto); if (ip6info->proto == protohdr) { - if (ip6info->invflags & IP6T_INV_PROTO) { + if (ip6info->invflags & IP6T_INV_PROTO) return false; - } return true; } diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index 07d8534..a7f6977 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c @@ -527,9 +527,9 @@ find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff) struct ipv6_opt_hdr hdr; int hdrlen; - if (!ipv6_ext_hdr(nexthdr)) { + if (!ipv6_ext_hdr(nexthdr)) return -1; - } + if (nexthdr == NEXTHDR_NONE) { pr_debug("next header is none\n"); return -1;
Remove braces from a few if statements where not required. No changes detected by objdiff. Signed-off-by: Ian Morris <ipm@chirality.org.uk> --- net/ipv6/netfilter/ip6_tables.c | 3 +-- net/ipv6/netfilter/nf_conntrack_reasm.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-)