[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cb4591d2-1e71-c04d-fd7a-c8536716000b@huawei.com>
Date: Fri, 23 Sep 2022 09:55:07 +0800
From: Jason Yan <yanaijie@...wei.com>
To: John Garry <john.garry@...wei.com>, <martin.petersen@...cle.com>,
<jejb@...ux.ibm.com>
CC: <linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<hare@...e.com>, <hch@....de>, <bvanassche@....org>,
<jinpu.wang@...ud.ionos.com>
Subject: Re: [PATCH 6/7] scsi: pm8001: use dev_and_phy_addr_same() instead of
open coded
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@...wei.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;
>> }
>
> .
Powered by blists - more mailing lists