diff mbox series

[v3,8/8] scsi: libsas: use sas_phy_match_port_addr() instead of open coded

Message ID 20220927022941.4029476-9-yanaijie@huawei.com (mailing list archive)
State Superseded
Headers show
Series scsi: libsas: sas address comparation refactor | expand

Commit Message

Jason Yan Sept. 27, 2022, 2:29 a.m. UTC
The sas address comparation of asd_sas_port and expander phy is open
coded. Now we can replace it with sas_phy_match_port_addr().

Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
 drivers/scsi/libsas/sas_expander.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Damien Le Moal Sept. 27, 2022, 2:32 a.m. UTC | #1
On 9/27/22 11:29, Jason Yan wrote:
> The sas address comparation of asd_sas_port and expander phy is open
> coded. Now we can replace it with sas_phy_match_port_addr().

Comparison typo again.

> 
> Signed-off-by: Jason Yan <yanaijie@huawei.com>

With that fixed,

Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

> ---
>  drivers/scsi/libsas/sas_expander.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
> index f268291b7584..eabc56966f36 100644
> --- a/drivers/scsi/libsas/sas_expander.c
> +++ b/drivers/scsi/libsas/sas_expander.c
> @@ -1005,8 +1005,7 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id)
>  	}
>  
>  	/* Parent and domain coherency */
> -	if (!dev->parent && (SAS_ADDR(ex_phy->attached_sas_addr) ==
> -			     SAS_ADDR(dev->port->sas_addr))) {
> +	if (!dev->parent && sas_phy_match_port_addr(dev->port, ex_phy)) {
>  		sas_add_parent_port(dev, phy_id);
>  		return 0;
>  	}
diff mbox series

Patch

diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index f268291b7584..eabc56966f36 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -1005,8 +1005,7 @@  static int sas_ex_discover_dev(struct domain_device *dev, int phy_id)
 	}
 
 	/* Parent and domain coherency */
-	if (!dev->parent && (SAS_ADDR(ex_phy->attached_sas_addr) ==
-			     SAS_ADDR(dev->port->sas_addr))) {
+	if (!dev->parent && sas_phy_match_port_addr(dev->port, ex_phy)) {
 		sas_add_parent_port(dev, phy_id);
 		return 0;
 	}