Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2671043rdb; Mon, 4 Dec 2023 04:32:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHwCC6G3AjncDgATeRdrmyPwhrkDJldsx1l1CqnQ6ttJrXqlFS0XE7/c2nIobom04/glmmQ X-Received: by 2002:a05:6a00:c7:b0:6ce:6185:44e1 with SMTP id e7-20020a056a0000c700b006ce618544e1mr255026pfj.66.1701693173939; Mon, 04 Dec 2023 04:32:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701693173; cv=none; d=google.com; s=arc-20160816; b=tnscp7sxZQL7VNiHVqdZ9Nq0xXcWUNhk62yztTJpt3jmbvfNI9JbB4wZObCxWHTrBG ODiSoT4enIFNrQe+9VeBhoaG4Zwcc3cI+Zfohq4b8oHiQGcdVzVg+u7wyYcHpqgqA1PW j1X9Wn+jxrGnqWyX2NVMX6JnBN9aS/m4sewj20h/hQMGIvwuOWaBXYVyp/rXOAgw3v8r 9w2uFB17PbKbk0N+SozKsZPSloRaeV4C3HdCZShIqnH+iHdgpXS3Iyshmld/LH5x0ztg GF7C9fkOVwiHWwagvhQ/686/Ej7t537ghQ435dIWfBTKOyMCpZ/6TomGu2YYFJ3xwJAu +qUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=9Jojf4KWk4pMTgQTY6G3KI+fHzPy/W7xYw/IhVU18no=; fh=PKov2v7mtZqWrG2ToL14QCqscLF6oofVifdomTnOWI8=; b=cialNO1SI1cRN2u0x9bfPCA1vd9afNoLPc4NLlJoqIYiUKMuKsY0Y7W7Ao0OkaMfTx w7aZhMlIEsMa9p7c0q50iyZGVKDLHN+DfBZfcF0OGNsbbAFDwtSyhryUvXMvDn+NFiCw TrJ9G/GAAGs3HgTLWZ3dqEZP+aVoOgwoDrgkBOY5SAtnDibYbBw5FqQttwA+xH0nCCX1 rRNlHRmyhmY2nAYLiXF2Zd20Mx1SgTmd40HRS+gQnPVa0cA9zfL0VJPxIfimEiHr3ChI YLJm41JAvwCxijRDtyBdW0hDsdupkmU1kZbt8xUr0NLVKdJRq+1VRnBj8WCU+FNJEFH8 OLPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id w62-20020a636241000000b005c6707eedb1si2907118pgb.679.2023.12.04.04.32.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 04:32:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 461CF80952DC; Mon, 4 Dec 2023 04:32:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343986AbjLDMcb (ORCPT + 99 others); Mon, 4 Dec 2023 07:32:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232797AbjLDMc2 (ORCPT ); Mon, 4 Dec 2023 07:32:28 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 926BFC3; Mon, 4 Dec 2023 04:32:34 -0800 (PST) Received: from dggpemd100001.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4SkNJ00Ldhz1P9HW; Mon, 4 Dec 2023 20:28:48 +0800 (CST) Received: from localhost.localdomain (10.50.165.33) by dggpemd100001.china.huawei.com (7.185.36.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.28; Mon, 4 Dec 2023 20:32:32 +0800 From: Xingui Yang To: , , , , CC: , , , , , Subject: [PATCH v5 2/3] scsi: libsas: Move sas_add_parent_port() to sas_expander.c Date: Mon, 4 Dec 2023 12:29:31 +0000 Message-ID: <20231204122932.55741-3-yangxingui@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231204122932.55741-1-yangxingui@huawei.com> References: <20231204122932.55741-1-yangxingui@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.50.165.33] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemd100001.china.huawei.com (7.185.36.94) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 04 Dec 2023 04:32:49 -0800 (PST) Move sas_add_parent_port() to sas_expander.c since it is only used in this file. Signed-off-by: Xingui Yang --- drivers/scsi/libsas/sas_expander.c | 15 +++++++++++++++ drivers/scsi/libsas/sas_internal.h | 15 --------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 1257f90130fb..7aa968b85e1e 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -33,6 +33,21 @@ static void sas_port_add_ex_phy(struct sas_port *port, struct ex_phy *ex_phy) ex_phy->phy_state = PHY_DEVICE_DISCOVERED; } +static void sas_add_parent_port(struct domain_device *dev, int phy_id) +{ + struct expander_device *ex = &dev->ex_dev; + struct ex_phy *ex_phy = &ex->ex_phy[phy_id]; + + if (!ex->parent_port) { + ex->parent_port = sas_port_alloc(&dev->rphy->dev, phy_id); + /* FIXME: error handling */ + BUG_ON(!ex->parent_port); + BUG_ON(sas_port_add(ex->parent_port)); + sas_port_mark_backlink(ex->parent_port); + } + sas_port_add_phy(ex->parent_port, ex_phy->phy); +} + /* ---------- SMP task management ---------- */ /* Give it some long enough timeout. In seconds. */ diff --git a/drivers/scsi/libsas/sas_internal.h b/drivers/scsi/libsas/sas_internal.h index 3804aef165ad..85948963fb97 100644 --- a/drivers/scsi/libsas/sas_internal.h +++ b/drivers/scsi/libsas/sas_internal.h @@ -189,21 +189,6 @@ static inline void sas_phy_set_target(struct asd_sas_phy *p, struct domain_devic } } -static inline void sas_add_parent_port(struct domain_device *dev, int phy_id) -{ - struct expander_device *ex = &dev->ex_dev; - struct ex_phy *ex_phy = &ex->ex_phy[phy_id]; - - if (!ex->parent_port) { - ex->parent_port = sas_port_alloc(&dev->rphy->dev, phy_id); - /* FIXME: error handling */ - BUG_ON(!ex->parent_port); - BUG_ON(sas_port_add(ex->parent_port)); - sas_port_mark_backlink(ex->parent_port); - } - sas_port_add_phy(ex->parent_port, ex_phy->phy); -} - static inline struct domain_device *sas_alloc_device(void) { struct domain_device *dev = kzalloc(sizeof(*dev), GFP_KERNEL); -- 2.17.1