Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751164AbdGME3v convert rfc822-to-8bit (ORCPT ); Thu, 13 Jul 2017 00:29:51 -0400 Received: from mga06.intel.com ([134.134.136.31]:40692 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750857AbdGME3u (ORCPT ); Thu, 13 Jul 2017 00:29:50 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,352,1496127600"; d="scan'208";a="992398232" Subject: Re: [PATCH] stating: lustre: fix sparse error: incompatible types in comparison expression Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Oleg Drokin In-Reply-To: <20170713021017.5368-1-rui.teng@linux.vnet.ibm.com> Date: Thu, 13 Jul 2017 00:29:44 -0400 Cc: Andreas Dilger , James Simmons , "Greg Kroah-Hartman" , , , Content-Transfer-Encoding: 8BIT Message-Id: References: <20170713021017.5368-1-rui.teng@linux.vnet.ibm.com> To: Rui Teng X-Mailer: Apple Mail (2.1283) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1193 Lines: 39 On Jul 12, 2017, at 10:10 PM, Rui Teng wrote: > 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 > --- > 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; So the assignment is fine, but comparison is not? Strange. I guess this is fine by me if that makes the warning go away. Acked-by: Oleg Drokin > + if (next == head_up) > + return 0; > > ent = list_entry(next, struct lstcon_rpc_ent, rpe_link); > > -- > 2.11.0