Browse Source

staging: lustre: fix sparse error: incompatible types in comparison expression

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>
Acked-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Rui Teng 8 years ago
parent
commit
186882700f
1 changed files with 2 additions and 3 deletions
  1. 2 3
      drivers/staging/lustre/lnet/selftest/conrpc.c

+ 2 - 3
drivers/staging/lustre/lnet/selftest/conrpc.c

@@ -487,10 +487,9 @@ lstcon_rpc_trans_interpreter(struct lstcon_rpc_trans *trans,
 				   sizeof(struct list_head)))
 				   sizeof(struct list_head)))
 			return -EFAULT;
 			return -EFAULT;
 
 
-		if (tmp.next == head_up)
-			return 0;
-
 		next = tmp.next;
 		next = tmp.next;
+		if (next == head_up)
+			return 0;
 
 
 		ent = list_entry(next, struct lstcon_rpc_ent, rpe_link);
 		ent = list_entry(next, struct lstcon_rpc_ent, rpe_link);