Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1984231rwb; Sat, 24 Sep 2022 00:27:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Imv6Wk44pQNOltDMO6DQGhV4HH++Iy5WUI3xQMPctfJfzvfzzZqF8tM17KoROwmWIsYbB X-Received: by 2002:a17:902:9f90:b0:178:1a1c:85d with SMTP id g16-20020a1709029f9000b001781a1c085dmr12083611plq.85.1664004430162; Sat, 24 Sep 2022 00:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664004430; cv=none; d=google.com; s=arc-20160816; b=ZVrNAV0hOIX9oAVQwJG50MdKwqw9gqI1yPc5G0Ahom07uG8qRtXZTvT4T9+NMb/AFk YKtjFU+9XFpM1m0TtZN7wkeIvuRd/o0bH2yer9q0xCY3yvo1TPaa6HGR8j0r/1M05B0C ZU473HxBlMyn8mvxSx2Cjs23DtaqSFzzzSQIBjo8plxT0WsJA7BqMaM1XZno44qmGf2q W41VL+LyQNmQUH2cqKO9br5F4boZcX2h1ZfcnhPhhqwKMLzoZ8wGQJYb2bUgSIal6zRv pO92Cstz9Co8LroA6fATUyGQlJdYLf4tS4YdKPIhtQrGmgQENLqNztZqcupTihfiGa7g OWwQ== 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=6oMsIJCn/yfS2tLsg5YZ1PnNCwfijbZVobccJPuTUbM=; b=r8Imh2L1QXzyCJsOeZ+TuIl6B3Ulp6+aMwV0VoPW06OzDdJBqeXIKiyrH4EujsOxyM SU8F4b4cum/J6WSTiqffygWgiNTMih9cUrjKPTq1sM4k/4ATZv4DNDmLygB1wl2E2eWS XLVF+s+Otze5rnQOsZKBETzh5resyZ/QJcNsEYaq1T3JCaZTHe8aNSBBCrPMr5AFjzSs oZjAC/Ko4tdHqN2CjYM3TTkYx0g4m1ZZytAn85rR8K/t3634Vl/URwFuJFCXS1Ci4PWo 1lFa14v2dDwwOeqs795v2OWuhcnS9wZbq/r/2p7qSyEHYIMClkFrFxOS26PPPF7sso+9 +QZw== 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 s12-20020a056a00178c00b00535fd435cf6si12157502pfg.208.2022.09.24.00.26.58; Sat, 24 Sep 2022 00:27:10 -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 S233454AbiIXHY7 (ORCPT + 99 others); Sat, 24 Sep 2022 03:24:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233438AbiIXHYX (ORCPT ); Sat, 24 Sep 2022 03:24:23 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED08C13D867; Sat, 24 Sep 2022 00:24:21 -0700 (PDT) Received: from canpemm500004.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MZL7M1Vs9zHqM9; Sat, 24 Sep 2022 15:22:07 +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, 24 Sep 2022 15:24:19 +0800 From: Jason Yan To: , CC: , , , , , , , Jason Yan Subject: [PATCH v2 7/8] scsi: libsas: use sas_phy_addr_same() instead of open coded Date: Sat, 24 Sep 2022 15:34:54 +0800 Message-ID: <20220924073455.2186805-8-yanaijie@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220924073455.2186805-1-yanaijie@huawei.com> References: <20220924073455.2186805-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: dggems704-chm.china.huawei.com (10.3.19.181) 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 expander phys is open coded. Now we can replace it with sas_phy_addr_same(). 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 b2b5103c3e76..c9d738ad8176 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -2058,8 +2058,7 @@ static int sas_rediscover(struct domain_device *dev, const int phy_id) if (i == phy_id) continue; - if (SAS_ADDR(phy->attached_sas_addr) == - SAS_ADDR(changed_phy->attached_sas_addr)) { + if (sas_phy_addr_same(phy, changed_phy)) { last = false; break; } -- 2.31.1