public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Yan <yanaijie@huawei.com>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	<martin.petersen@oracle.com>, <jejb@linux.ibm.com>
Cc: <linux-scsi@vger.kernel.org>, <hare@suse.com>, <hch@lst.de>,
	<bvanassche@acm.org>, <jinpu.wang@cloud.ionos.com>,
	<john.g.garry@oracle.com>
Subject: Re: [PATCH 1/3] scsi: libsas: Simplify sas_check_eeds()
Date: Mon, 3 Apr 2023 09:37:46 +0800	[thread overview]
Message-ID: <e9729d4e-e6d1-7bf6-25a6-5de92214b019@huawei.com> (raw)
In-Reply-To: <739e2d17-f1c6-fc33-adc4-41cb97b5950d@opensource.wdc.com>

Hi Damien,

On 2023/4/2 12:58, Damien Le Moal wrote:
> On 4/1/23 17:15, Jason Yan wrote:
>> In sas_check_eeds() there is an empty branch. We can reverse the
>> test expression and then remove the empty branch. Also the the test
>> expression is a little bit complex so it deserves an individual
>> function. And make the continuing prototype lines indented after
>> the opening parenthesis to follow the standard coding style.
>>
>> Signed-off-by: Jason Yan <yanaijie@huawei.com>
>> ---
>>   drivers/scsi/libsas/sas_expander.c | 38 ++++++++++++++----------------
>>   1 file changed, 18 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
>> index dc670304f181..048a931d856a 100644
>> --- a/drivers/scsi/libsas/sas_expander.c
>> +++ b/drivers/scsi/libsas/sas_expander.c
>> @@ -1198,37 +1198,35 @@ static void sas_print_parent_topology_bug(struct domain_device *child,
>>   		  sas_route_char(child, child_phy));
>>   }
>>   
>> +static bool sas_eeds_valid(struct domain_device *parent, struct domain_device *child)
>> +{
>> +	struct sas_discovery *disc = &parent->port->disc;
> 
> Missing blank line after declaration.

OK.

> 
>> +	return (((SAS_ADDR(disc->eeds_a) == SAS_ADDR(parent->sas_addr)) ||
>> +		 (SAS_ADDR(disc->eeds_a) == SAS_ADDR(child->sas_addr))) &&
>> +		((SAS_ADDR(disc->eeds_b) == SAS_ADDR(parent->sas_addr)) ||
>> +		 (SAS_ADDR(disc->eeds_b) == SAS_ADDR(child->sas_addr))));
> 
> Drop the inner-most and outter-most parenthesis.

No problem.

Thanks,
Jason

  reply	other threads:[~2023-04-03  1:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-01  8:15 [PATCH 0/3] scsi: libsas: remove empty branches and code simplification Jason Yan
2023-04-01  8:15 ` [PATCH 1/3] scsi: libsas: Simplify sas_check_eeds() Jason Yan
2023-04-02  4:58   ` Damien Le Moal
2023-04-03  1:37     ` Jason Yan [this message]
2023-04-03  8:12       ` John Garry
2023-04-03  9:11         ` Jason Yan
2023-04-01  8:15 ` [PATCH 2/3] scsi: libsas: Remove an empty branch in sas_check_parent_topology() Jason Yan
2023-04-01  8:15 ` [PATCH 3/3] scsi: libsas: Simplify sas_check_parent_topology() Jason Yan
2023-04-02  5:00   ` Damien Le Moal
2023-04-03  2:07     ` Jason Yan
2023-04-03  3:13     ` Jason Yan

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=e9729d4e-e6d1-7bf6-25a6-5de92214b019@huawei.com \
    --to=yanaijie@huawei.com \
    --cc=bvanassche@acm.org \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=jejb@linux.ibm.com \
    --cc=jinpu.wang@cloud.ionos.com \
    --cc=john.g.garry@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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