Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1742995

[PATCH 2/3] evaluate: Place constant on right side in comparison

From Harsha Sharma <harshasharmaiitr@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 2/3] evaluate: Place constant on right side in comparison
Date 2017-10-02 09:40 +0200
Message-ID <uw3uy-4tG-15@gated-at.bofh.it> (permalink)
References <uw3ux-4tG-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Comparisons should place the constant on the right side of the test
as per linux-kernel coding style

Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
---
 src/evaluate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/evaluate.c b/src/evaluate.c
index 5624ca2..b783054 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -2174,13 +2174,13 @@ static int stmt_evaluate_reject_bridge_family(struct eval_ctx *ctx,
 		protocol = proto_find_num(base, desc);
 		switch (protocol) {
 		case __constant_htons(ETH_P_IP):
-			if (NFPROTO_IPV4 == stmt->reject.family)
+			if (stmt->reject.family == NFPROTO_IPV4)
 				break;
 			return stmt_binary_error(ctx, stmt->reject.expr,
 				  &ctx->pctx.protocol[PROTO_BASE_NETWORK_HDR],
 				  "conflicting protocols specified: ip vs ip6");
 		case __constant_htons(ETH_P_IPV6):
-			if (NFPROTO_IPV6 == stmt->reject.family)
+			if (stmt->reject.family == NFPROTO_IPV6)
 				break;
 			return stmt_binary_error(ctx, stmt->reject.expr,
 				  &ctx->pctx.protocol[PROTO_BASE_NETWORK_HDR],
-- 
1.9.1

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] evaluate: Follow linux-kernel coding style Harsha Sharma <harshasharmaiitr@gmail.com> - 2017-10-02 09:40 +0200
  [PATCH 3/3] evaluate: make pointers in string arrays constant  Harsha Sharma <harshasharmaiitr@gmail.com> - 2017-10-02 09:40 +0200
  [PATCH 2/3] evaluate: Place constant on right side in comparison Harsha Sharma <harshasharmaiitr@gmail.com> - 2017-10-02 09:40 +0200
  [PATCH 1/3] evaluate: Remove unnecessary spaces Harsha Sharma <harshasharmaiitr@gmail.com> - 2017-10-02 09:40 +0200

csiph-web