Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp300272rwb; Mon, 26 Sep 2022 19:21:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7CQJdDY4rCJyy5pOtUHWspVyv4Q4JLsaG3fpYGZvHCtll00zshR9kNC7Y6weWg0FpZRpKE X-Received: by 2002:a17:902:8c92:b0:178:29d4:600f with SMTP id t18-20020a1709028c9200b0017829d4600fmr25363623plo.40.1664245294554; Mon, 26 Sep 2022 19:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664245294; cv=none; d=google.com; s=arc-20160816; b=jj1LPfEGEhvie3nheNmsdeAKXJsAtqJIPrbaRnbX3QQX8SLGhREzeZkpV97WdxGiuB JJSMRMLTrw1yL13ww6gQHggJePP4P8jmGD4PTsJpPqYPjT1LyYQl0lXDBiu0My6U5T7I k9iqT1Q/PRrNBlZs3yB1sR3lzjKmU2KIwfsHQ1ROQaqpZQBKxMSqxam3Z1f/Sqefv/YW 1WjyU4qAtdlB3v7hL6URiwwVfb4lNZ5oDZ2n42+rYz7OqeMRxh8j8Dkl5cp+xmPXgsH8 sExW2U66T4YocxGeNyIMQt+xohCd/M6ep19H1oz4xZbod+ZddAJ6oe2XkJXQHEB0n8j8 SFiw== 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=dkeTArIXgdvg/SuHo9l5ruhQVQTyuNn5mJA+nHrtLqI=; b=VYzY4VFQITlEpiiw/B4w1p3F62jbv5FHoLhScIbbs1VZurifmawUqPNBo6Wljy/TyU tSDkTkVOhjy9ocM8ucYMCHTHKQZSFjwAVHMg6bnvQM4X/naiyt2CpvSCF9us5misGsmh a0hqk3AF/EB3ItX7gjvSVOsLl62EyHfXXzZd7boZoLrlgUp0379nlMw2xd3QVYdcYf7Y 8W7yNmRaXyxYb1ZRoQq5NYzs4+ctDOKe2Kuleul0a/8l/c6HrrE1OqB82U9WdylCOOZu 05G6rbL4aGt1Hg+BPXtTLiDL7X3aExoeXZU1TiB19QuB7lkTqJ1oghO/uZnm3jxqlED1 21lA== 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 e3-20020a170902ef4300b0016be68156aesi361325plx.173.2022.09.26.19.21.22; Mon, 26 Sep 2022 19:21:34 -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 S230164AbiI0CTj (ORCPT + 99 others); Mon, 26 Sep 2022 22:19:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230059AbiI0CTO (ORCPT ); Mon, 26 Sep 2022 22:19:14 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DC7FA98CA; Mon, 26 Sep 2022 19:19:11 -0700 (PDT) Received: from canpemm500004.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Mc3C25VtszpTgj; Tue, 27 Sep 2022 10:16:14 +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; Tue, 27 Sep 2022 10:19:09 +0800 From: Jason Yan To: , CC: , , , , , , , Jason Yan Subject: [PATCH v3 8/8] scsi: libsas: use sas_phy_match_port_addr() instead of open coded Date: Tue, 27 Sep 2022 10:29:41 +0800 Message-ID: <20220927022941.4029476-9-yanaijie@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220927022941.4029476-1-yanaijie@huawei.com> References: <20220927022941.4029476-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 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 --- 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; } -- 2.31.1