[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AANLkTikhp0HvT2=2m9U__tqSxZbJmrbSDX+7_ZOddddt@mail.gmail.com>
Date: Sun, 12 Sep 2010 10:28:25 -0700
From: Mike Fedyk <mfedyk@...efedyk.com>
To: Jaswinder Singh Rajput <jaswinderlinux@...il.com>
Cc: Johannes Weiner <hannes@...xchg.org>,
Chris Mason <chris.mason@...cle.com>,
linux-btrfs@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Btrfs: Remove useless condition
On Sun, Sep 12, 2010 at 6:56 AM, Jaswinder Singh Rajput
<jaswinderlinux@...il.com> wrote:
> Hello,
>
> On Sun, Sep 12, 2010 at 5:59 PM, Johannes Weiner <hannes@...xchg.org> 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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists