From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Fedyk Subject: Re: [PATCH] Btrfs: Remove useless condition Date: Sun, 12 Sep 2010 10:28:25 -0700 Message-ID: References: <1284289340.2650.2.camel@ht.satnam> <20100912122955.GA28839@cmpxchg.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Johannes Weiner , Chris Mason , linux-btrfs@vger.kernel.org, LKML To: Jaswinder Singh Rajput Return-path: In-Reply-To: List-ID: On Sun, Sep 12, 2010 at 6:56 AM, Jaswinder Singh Rajput wrote: > Hello, > > On Sun, Sep 12, 2010 at 5:59 PM, Johannes Weiner wrote: >> On Sun, Sep 12, 2010 at 04:32:20PM +0530, Jaswinder Singh Rajput wrote: >>> >>> if (ret) is useless as it will be never NULL as in previous statement >>> we are setting ret = prev for !ret >> >> If there is no match and no extent below the given file offset, `prev' >> will be NULL as well, no? >> >> So the check is not useless, it prevents throwing out a cached success >> in case of a lookup failure. >> > > Got it !! > Wouldn't it be clearer and easier to read if prev was checked directly instead of checking ret after it becomes the same as prev?