From: Jason Yan <yanaijie@huawei.com>
To: John Garry <john.garry@huawei.com>, <martin.petersen@oracle.com>,
<jejb@linux.ibm.com>
Cc: <linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<hare@suse.com>, <hch@lst.de>, <bvanassche@acm.org>,
<jinpu.wang@cloud.ionos.com>
Subject: Re: [PATCH 6/7] scsi: pm8001: use dev_and_phy_addr_same() instead of open coded
Date: Fri, 23 Sep 2022 09:55:07 +0800 [thread overview]
Message-ID: <cb4591d2-1e71-c04d-fd7a-c8536716000b@huawei.com> (raw)
In-Reply-To: <0034eff3-70a5-becb-0821-f9c36371e6d9@huawei.com>
On 2022/9/22 22:24, John Garry wrote:
> On 17/09/2022 11:43, Jason Yan wrote:
>> The sas address comparation of domain device and expander phy is open
>> coded. Now we can replace it with dev_and_phy_addr_same().
>>
>> Signed-off-by: Jason Yan <yanaijie@huawei.com>
>> ---
>> drivers/scsi/pm8001/pm8001_sas.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/drivers/scsi/pm8001/pm8001_sas.c
>> b/drivers/scsi/pm8001/pm8001_sas.c
>> index 8e3f2f9ddaac..bb1b1722f3ee 100644
>> --- a/drivers/scsi/pm8001/pm8001_sas.c
>> +++ b/drivers/scsi/pm8001/pm8001_sas.c
>> @@ -649,8 +649,7 @@ static int pm8001_dev_found_notify(struct
>> domain_device *dev)
>> for (phy_id = 0; phy_id < parent_dev->ex_dev.num_phys;
>
> This code seems the same between many libsas LLDDs - could we factor it
> out into libsas?
Sure we can. I will try to factor it out in the next revision.
Thanks,
Jason
If so, then maybe those new helpers could be put in
> sas_internal.h
>
> Thanks,
> John
>
>> phy_id++) {
>> phy = &parent_dev->ex_dev.ex_phy[phy_id];
>> - if (SAS_ADDR(phy->attached_sas_addr)
>> - == SAS_ADDR(dev->sas_addr)) {
>> + if (dev_and_phy_addr_same(dev, phy)) {
>> pm8001_device->attached_phy = phy_id;
>> break;
>> }
>
> .
next prev parent reply other threads:[~2022-09-23 1:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-17 10:43 [PATCH 0/7] scsi: libsas: sas address comparation refactor Jason Yan
2022-09-17 10:43 ` [PATCH 1/7] scsi: libsas: introduce sas address conversion and comparation helpers Jason Yan
2022-09-22 14:14 ` John Garry
2022-09-17 10:43 ` [PATCH 2/7] scsi: libsas: use dev_and_phy_addr_same() instead of open coded Jason Yan
2022-09-17 10:43 ` [PATCH 3/7] scsi: libsas: use ex_phy_addr_same() " Jason Yan
2022-09-17 10:43 ` [PATCH 4/7] scsi: libsas: use port_and_phy_addr_same() " Jason Yan
2022-09-17 10:43 ` [PATCH 5/7] scsi: hisi_sas: use dev_and_phy_addr_same() " Jason Yan
2022-09-17 10:43 ` [PATCH 6/7] scsi: pm8001: " Jason Yan
2022-09-22 14:24 ` John Garry
2022-09-23 1:55 ` Jason Yan [this message]
2022-09-23 9:44 ` Jason Yan
2022-09-23 10:00 ` John Garry
2022-09-23 10:10 ` Jason Yan
2022-09-23 10:13 ` Jason Yan
2022-09-23 10:30 ` John Garry
2022-09-24 3:22 ` Jason Yan
2022-09-17 10:43 ` [PATCH 7/7] scsi: mvsas: " 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=cb4591d2-1e71-c04d-fd7a-c8536716000b@huawei.com \
--to=yanaijie@huawei.com \
--cc=bvanassche@acm.org \
--cc=hare@suse.com \
--cc=hch@lst.de \
--cc=jejb@linux.ibm.com \
--cc=jinpu.wang@cloud.ionos.com \
--cc=john.garry@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®