From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAE65C54EE9 for ; Thu, 22 Sep 2022 14:25:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231639AbiIVOY4 (ORCPT ); Thu, 22 Sep 2022 10:24:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbiIVOYf (ORCPT ); Thu, 22 Sep 2022 10:24:35 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11C619FE7; Thu, 22 Sep 2022 07:24:34 -0700 (PDT) Received: from fraeml737-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MYHV84HPxz67M1h; Thu, 22 Sep 2022 22:19:44 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by fraeml737-chm.china.huawei.com (10.206.15.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 22 Sep 2022 16:24:31 +0200 Received: from [10.195.244.8] (10.195.244.8) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 22 Sep 2022 15:24:31 +0100 Message-ID: <0034eff3-70a5-becb-0821-f9c36371e6d9@huawei.com> Date: Thu, 22 Sep 2022 15:24:30 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH 6/7] scsi: pm8001: use dev_and_phy_addr_same() instead of open coded To: Jason Yan , , CC: , , , , , References: <20220917104311.1878250-1-yanaijie@huawei.com> <20220917104311.1878250-7-yanaijie@huawei.com> From: John Garry In-Reply-To: <20220917104311.1878250-7-yanaijie@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.195.244.8] X-ClientProxiedBy: lhrpeml100003.china.huawei.com (7.191.160.210) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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? 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; > }