linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Fedyk <mfedyk@mikefedyk.com>
To: Jaswinder Singh Rajput <jaswinderlinux@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	Chris Mason <chris.mason@oracle.com>,
	linux-btrfs@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Btrfs: Remove useless condition
Date: Sun, 12 Sep 2010 10:28:25 -0700	[thread overview]
Message-ID: <AANLkTikhp0HvT2=2m9U__tqSxZbJmrbSDX+7_ZOddddt@mail.gmail.com> (raw)
In-Reply-To: <AANLkTinPWd2bavC_44WkEL++KXirZ1CW3dTNK7G-Oag=@mail.gmail.com>

On Sun, Sep 12, 2010 at 6:56 AM, Jaswinder Singh Rajput
<jaswinderlinux@gmail.com> wrote:
> Hello,
>
> On Sun, Sep 12, 2010 at 5:59 PM, Johannes Weiner <hannes@cmpxchg.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?

      reply	other threads:[~2010-09-12 17:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-12 11:02 [PATCH] Btrfs: Remove useless condition Jaswinder Singh Rajput
2010-09-12 12:29 ` Johannes Weiner
2010-09-12 13:56   ` Jaswinder Singh Rajput
2010-09-12 17:28     ` Mike Fedyk [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTikhp0HvT2=2m9U__tqSxZbJmrbSDX+7_ZOddddt@mail.gmail.com' \
    --to=mfedyk@mikefedyk.com \
    --cc=chris.mason@oracle.com \
    --cc=hannes@cmpxchg.org \
    --cc=jaswinderlinux@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).