Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp192494rwb; Sat, 17 Sep 2022 03:33:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4wdCrQRm7trDpSkKEEi+QFQKvDFe9cMf2PQ3KoiHm3KbuPvwHr2SW/qzUGiiPJfxaLmOiw X-Received: by 2002:a17:90a:db04:b0:203:6731:caf8 with SMTP id g4-20020a17090adb0400b002036731caf8mr4019622pjv.190.1663410830997; Sat, 17 Sep 2022 03:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663410830; cv=none; d=google.com; s=arc-20160816; b=O1eQSEzA0LyLWbEGz6u8hqFaaekw+qdYcHt2NYlG7UmAGxcsLXvgQmPU38aS21S+VH dbhPIKSlthTttDEA6W+PpTmxX+WdFWa5SFLrreTdRaE+c5wD3OoPQt4MBIUPi+S3aYwp ambjB6c2UEQxhNV6TGmNbwu8w2EU3rIf1qHX+uWgv3fEBJpMwPSrU/uGFpQiLKMCkNXt OlK6eRpN3PpBByKDxuptsd//kf8aWkW3R93W5MFyYb6sSJeNMlhw5nZ9Lgxw/7V35l1z YfHhUxsqESONdt5ph9/nW8pnoXYpj9Sk5k45jcMs4tZY/B0jhVUKYxZCKFxqwvkiW0nw 6QVw== 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=aJXiYZgjv6BF/44tmuKmwAUbOjSZP9jmsVqjQBdmzac=; b=m9mj9E/a9UH14zKb5KnyNlIoh7LGXJ+TBFfa7qa+QHfCfDkcMECw8tHW0hkIZJMNnV +f91h70UZ6APlaSKRCXK9p30VVWVBpX58aJt4nLzpNJTuFu4xSA1NklcEDlBx6SWhfJ3 77oG1XecOEQ6F9L/XgQ5OkC0V9dfxwtGo1ChOdOjBCYsSptWMhOSkSqgy0kQdN6NVGu8 HjRx+xJ52NtkEtcscOiRRyieakZeH0hSsYOtXoVdDtJRkep570J40pebMgj6z8YJ3GpX iMUMxxAHKY8XBYrihlvnSjE+OynT9dGzo3dMlygZL4VqFX28QL+JCwrzumZ3AyXNEYtq hdOg== 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 t6-20020a17090340c600b00176bccea71esi19060778pld.57.2022.09.17.03.33.39; Sat, 17 Sep 2022 03:33:50 -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 S229618AbiIQKce (ORCPT + 99 others); Sat, 17 Sep 2022 06:32:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbiIQKc0 (ORCPT ); Sat, 17 Sep 2022 06:32:26 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA6D73137F; Sat, 17 Sep 2022 03:32:25 -0700 (PDT) Received: from canpemm500004.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MV6Zn4twTzMmxq; Sat, 17 Sep 2022 18:27:45 +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:23 +0800 From: Jason Yan To: , CC: , , , , , , , Jason Yan Subject: [PATCH 4/7] scsi: libsas: use port_and_phy_addr_same() instead of open coded Date: Sat, 17 Sep 2022 18:43:08 +0800 Message-ID: <20220917104311.1878250-5-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 asd_sas_port and expander phy is open coded. Now we can replace it with port_and_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 18b008f039be..667b276caeee 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 && port_and_phy_addr_same(dev->port, ex_phy)) { sas_add_parent_port(dev, phy_id); return 0; } -- 2.31.1