From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758707AbXKNClK (ORCPT ); Tue, 13 Nov 2007 21:41:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755158AbXKNCk5 (ORCPT ); Tue, 13 Nov 2007 21:40:57 -0500 Received: from mx2.suse.de ([195.135.220.15]:58435 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755049AbXKNCk4 (ORCPT ); Tue, 13 Nov 2007 21:40:56 -0500 From: Neil Brown To: Joe Perches Date: Wed, 14 Nov 2007 13:40:47 +1100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18234.24623.742782.328651@notabene.brown> Cc: linux-kernel , Linus Torvalds , Trond Myklebust , nfs@lists.sourceforge.net Subject: Re: [PATCH] - [7/15] - remove defconfig ptr comparisons to 0 - fs/lockd In-Reply-To: message from Joe Perches on Tuesday November 13 References: <1195005918.5163.93.camel@localhost> X-Mailer: VM 7.19 under Emacs 21.4.1 X-face: [Gw_3E*Gng}4rRrKRYotwlE?.2|**#s9D Remove defconfig ptr comparison to 0 > > Remove sparse warning: Using plain integer as NULL pointer > > Signed-off-by: Joe Perches > > --- > > diff --git a/fs/lockd/svcshare.c b/fs/lockd/svcshare.c > index 068886d..98548ad 100644 > --- a/fs/lockd/svcshare.c > +++ b/fs/lockd/svcshare.c > @@ -71,7 +71,7 @@ nlmsvc_unshare_file(struct nlm_host *host, struct nlm_file *file, > struct nlm_share *share, **shpp; > struct xdr_netobj *oh = &argp->lock.oh; > > - for (shpp = &file->f_shares; (share = *shpp) != 0; shpp = &share->s_next) { > + for (shpp = &file->f_shares; (share = *shpp); shpp = &share->s_next) { > if (share->s_host == host && nlm_cmp_owner(share, oh)) { > *shpp = share->s_next; > kfree(share); > I particularly disagree with this change as it now looked like it could be an '==' comparison that was mistyped. Making it ....; (share = *shpp) != NULL; .... makes the intent clear. NeilBrown