Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp939079rwb; Thu, 22 Sep 2022 08:11:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7peQDVHt2d/aA76c88DgH3yUa2DtyJYF7IcKXkxGRgQwTvVZADVcTW89evk9OMHop8sfbl X-Received: by 2002:a63:da4b:0:b0:439:14a8:52b with SMTP id l11-20020a63da4b000000b0043914a8052bmr3320920pgj.500.1663859475535; Thu, 22 Sep 2022 08:11:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663859475; cv=none; d=google.com; s=arc-20160816; b=vTBfVsANnTJ6wK/jnOmUkozXmlrwvLkxnrwNalYJkyijYgozK3ZhJHfzngAwlJiTSl 4apjd1vK8CADhC71MxYXBWe059H+ANbIDGWS2Qsl6+qeyyZSqaKWU7K6QzyefBUn7liG PxZV+YrD7WzAi1lmn4TVqqVC91OYSUOW3JOICIr4M+T++oy+PdsGcTYTYwaJ8XiJueEV 8tFmwicmfyGV0gmzUYNSoZnncOeRxEJq0BlJ7/8uzZz3W9H4ZLcawiK6Cc1CF8hfak3H tKCpuIEWTirOyuP8uPgpycVaHiOAgQ0fi2XQWJNmV3Ih/lKncHYbR0OibzV7H2JBq1/p JJZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=aV5wKCbxTHecEfekznuAWxvtCR2UPr6njqSWtij9vOw=; b=yHWWfI83ayVIZw+rGoj4T7MOqdP/L/cj0/7heO/PA5PSXhAHyafVnswmabsCMitHXZ K1ekAKV43WA3h8lTEWRS9XmcdOeRKi6ZcK3o/iriOEUNe78aMv4dI96shZFa+J/1w80e cGuCBlnNs3B5w8kcSbaZqs5cQ79jfCU4+KjP4KAQgjTdky7jS6/XdDzIKUAN4Ed7qQlj YPL3c+iLkAHdaeLOlzMkW+2y8RTtU0cDozQdJCrzspK71gef4BvFHmtfHYpJPOfDrEkI mkhQmW/n3i2/6hHi8dhOgF6tRBo4n9QlhmSKPRsEga2TDujADwBRltTMj8EjSqTzkM4c cDXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s8-20020a63f048000000b0043634245eb1si6390374pgj.311.2022.09.22.08.10.36; Thu, 22 Sep 2022 08:11:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231559AbiIVOYz (ORCPT + 99 others); Thu, 22 Sep 2022 10:24:55 -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 X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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; > }