mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wu Bo <wubo40@huawei.com>
To: Christoph Hellwig <hch@lst.de>
Cc: <kbusch@kernel.org>, <axboe@fb.com>, <sagi@grimberg.me>,
	<linux-nvme@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
	<linfeilong@huawei.com>
Subject: Re: [PATCH] nvme-multipath: combine grpid and ANA state checks in nvme_parse_ana_log()
Date: Tue, 8 Jun 2021 20:32:15 +0800	[thread overview]
Message-ID: <0f672080-671b-c1b8-18d5-3ddad90f53c4@huawei.com> (raw)
In-Reply-To: <20210608052320.GA13828@lst.de>

On 2021/6/8 13:23, Christoph Hellwig wrote:
> On Tue, Jun 08, 2021 at 12:13:36PM +0800, Wu Bo wrote:
>> -		if (WARN_ON_ONCE(desc->grpid == 0))
>> +		if (WARN_ON_ONCE(desc->grpid == 0 ||
>> +			le32_to_cpu(desc->grpid) > ctrl->anagrpmax))
>>   			return -EINVAL;
>> -		if (WARN_ON_ONCE(le32_to_cpu(desc->grpid) > ctrl->anagrpmax))
>> -			return -EINVAL;
>> -		if (WARN_ON_ONCE(desc->state == 0))
>> -			return -EINVAL;
>> -		if (WARN_ON_ONCE(desc->state > NVME_ANA_CHANGE))
>> +		if (WARN_ON_ONCE(desc->state == 0 ||
>> +			desc->state > NVME_ANA_CHANGE))
> 
> So besides making the code impossibl to read due to the incorrect
> indentation this also makes each WARN_ON_ONCE cover multiple conditions.
> Not very useful for debugging.
> .
> 

Indeed, not very useful for debugging, please ignore this patch.

Thanks,
Wu Bo


      parent reply	other threads:[~2021-06-08 12:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08  4:13 Wu Bo
2021-06-08  4:55 ` Chaitanya Kulkarni
2021-06-08  5:23 ` Christoph Hellwig
2021-06-08 12:30   ` Wu Bo
2021-06-08 12:32   ` Wu Bo [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=0f672080-671b-c1b8-18d5-3ddad90f53c4@huawei.com \
    --to=wubo40@huawei.com \
    --cc=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linfeilong@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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

all inboxes | Powered by JetHome®