Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp194699rwb; Sat, 17 Sep 2022 03:36:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4xcI/6WczWQ9slHJGQNzI4e7jCUU4V3q0+X66QkmNPjopZFpup9xXvM3dTv9uppa9djp7U X-Received: by 2002:a17:90b:4c8f:b0:202:bcbb:1984 with SMTP id my15-20020a17090b4c8f00b00202bcbb1984mr20308353pjb.64.1663411008298; Sat, 17 Sep 2022 03:36:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663411008; cv=none; d=google.com; s=arc-20160816; b=YgkiVqlvtc+VhO8FbU/W8mlbGR3AqKtObOWnNMVtRrsOel/XPTKYBJI1S8yihNy1yC OTBznxqzNlCawftLlCcudnZVPN7Y/K6VT2GbUSWrrbRsrcYlxXF5nyAb7j63J0/9Hwom 0RtS4H+TiOdeWRy29uil/t6wTLxnbl3HgSZaQfO73NREStW8Y9ZIkjr39wKn6XRz7Rec o1pGCE0+zUfjEyJyc1tTgoZ0g30aObsehINq/pmc4KA0uCvQVCZkpFNYHQNQYYlARyLO nOlQOdExwEXQkDNM4APgj60RGMCC7QY/j1dVica4zr50bpDIibyI/kXu0CHc2bBpSNa9 2MJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=MdJKNAk3zey1rRydS+yuMxQ59vqH7SvNHxcWQgzKLGo=; b=B87xxe9dNPduBosMOBC0mqKSP9Sfk1AtItRdtkImImQnoVm6x1RzlWrDdIUiZw5MI9 1TKVqymxryM0y9Y1oUBVlH1eTvyFFOx7lNE6nT7Ftc4uL6+Y8UMBGf3NErcX46Nbnnrq A9D/q5iwXLsZhkzqLJUc0jOce75+/YIBsobHDMzQjc6VjLrLz9NSF8Ru9aGpGWWoEToI H/3bwZvKWAkrT1Zs5rSaoBircG02aclGH/vz/+z8NYWvm0NTuQitvh3xYE3LrmIFcLCq Np1X5bCQrgSohGO5UiPMQh7ZoWQ4V40AhxuyLepMv5OX+1bzXS1ehhBgCcxX3mn/oRtf V1tg== 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 g28-20020a63201c000000b00438894ca922si24889128pgg.669.2022.09.17.03.36.36; Sat, 17 Sep 2022 03:36:48 -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 S229613AbiIQKdL (ORCPT + 99 others); Sat, 17 Sep 2022 06:33:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229568AbiIQKc2 (ORCPT ); Sat, 17 Sep 2022 06:32:28 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75EB53122B; Sat, 17 Sep 2022 03:32:27 -0700 (PDT) Received: from canpemm500004.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MV6dm2zxmzHnVp; Sat, 17 Sep 2022 18:30:20 +0800 (CST) Received: from huawei.com (10.175.127.227) by canpemm500004.china.huawei.com (7.192.104.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 17 Sep 2022 18:32:25 +0800 From: Jason Yan To: , CC: , , , , , , , Jason Yan Subject: [PATCH 7/7] scsi: mvsas: use dev_and_phy_addr_same() instead of open coded Date: Sat, 17 Sep 2022 18:43:11 +0800 Message-ID: <20220917104311.1878250-8-yanaijie@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220917104311.1878250-1-yanaijie@huawei.com> References: <20220917104311.1878250-1-yanaijie@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500004.china.huawei.com (7.192.104.92) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 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/mvsas/mv_sas.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c index a6867dae0e7c..766e02c3f459 100644 --- a/drivers/scsi/mvsas/mv_sas.c +++ b/drivers/scsi/mvsas/mv_sas.c @@ -1194,8 +1194,7 @@ static int mvs_dev_found_notify(struct domain_device *dev, int lock) struct ex_phy *phy; for (phy_id = 0; phy_id < phy_num; 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)) { mvi_device->attached_phy = phy_id; break; } -- 2.31.1