From: Jason Yan Date: Wed, 28 Sep 2022 07:01:30 +0000 (+0800) Subject: scsi: libsas: Use sas_phy_match_port_addr() instead of open coding it X-Git-Tag: v6.2-rc1~97^2~114 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=868a8824838f1f0d781e838fa36dbb2de6bc7fdd;p=thirdparty%2Fkernel%2Flinux.git scsi: libsas: Use sas_phy_match_port_addr() instead of open coding it The SAS address comparison of asd_sas_port and expander phy is open coded. Replace it with sas_phy_match_port_addr(). Signed-off-by: Jason Yan Link: https://lore.kernel.org/r/20220928070130.3657183-9-yanaijie@huawei.com Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index caa0b22867335..2907ca5d0ed43 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; }