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


Groups > linux.kernel > #1686183

[PATCH] stating: lustre: fix sparse error: incompatible types in comparison expression

From Rui Teng <rui.teng@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH] stating: lustre: fix sparse error: incompatible types in comparison expression
Date 2017-07-13 04:20 +0200
Message-ID <u2BTr-81c-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Comparing two user space addresses to avoid sparse error:

drivers/staging//lustre/lnet/selftest/conrpc.c:490:30: error:
incompatible types in comparison expression (different address spaces)

Signed-off-by: Rui Teng <rui.teng@linux.vnet.ibm.com>
---
 drivers/staging/lustre/lnet/selftest/conrpc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c
index da36c55b86d3..ae7c2772825e 100644
--- a/drivers/staging/lustre/lnet/selftest/conrpc.c
+++ b/drivers/staging/lustre/lnet/selftest/conrpc.c
@@ -487,10 +487,9 @@ lstcon_rpc_trans_interpreter(struct lstcon_rpc_trans *trans,
 				   sizeof(struct list_head)))
 			return -EFAULT;
 
-		if (tmp.next == head_up)
-			return 0;
-
 		next = tmp.next;
+		if (next == head_up)
+			return 0;
 
 		ent = list_entry(next, struct lstcon_rpc_ent, rpe_link);
 
-- 
2.11.0

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


Thread

[PATCH] stating: lustre: fix sparse error: incompatible types in comparison expression Rui Teng <rui.teng@linux.vnet.ibm.com> - 2017-07-13 04:20 +0200
  Re: [PATCH] stating: lustre: fix sparse error: incompatible types in comparison expression Oleg Drokin <oleg.drokin@intel.com> - 2017-07-13 06:40 +0200

csiph-web