From patchwork Mon Nov 23 17:41:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 330680 Delivered-To: patch@linaro.org Received: by 2002:a92:ae0b:0:0:0:0:0 with SMTP id s11csp2204176ilh; Mon, 23 Nov 2020 09:47:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSp1mkO3iSDQYKTADtapU9m1zUNtYBb81JM0o3On9x7yPWCLH3YZd3qzEaHygH9u9KLddH X-Received: by 2002:a17:906:3782:: with SMTP id n2mr637968ejc.493.1606153625207; Mon, 23 Nov 2020 09:47:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606153625; cv=none; d=google.com; s=arc-20160816; b=hmmm5Xz5NXcGcV2npw42FcvEStpO2vLjUiiJUkb6AqKRYlOb5pIfuLOumXj3dL834V OIJzpBTp3nFZ/+c4jFnTFHsGj6jBqk4YFJvMFZx3YPgxEfJxRWi/wpZxU9vX+pUcmXPC 5U5EVvLJmZrnHxQBKnQ2ULjkAVm6HZwusS/cFB9/8zn/bEMxsJKo1ViYLB0idIoS5yAX /IL7Fw2XsV6KqTp8YTE5B6pA98OQYEZJ0QZQSckLEdnck6GBCZO344IOvNpPinkyFEI/ 8KNS+Tx611I+KRIW98bbMQvULMR1SDK/OGqgjIhq95AOBmJAKOC0TA2Boz3U3BD1ClYg Gl9w== 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=448RktII+ce2oMZkcbiAuiDQ5xSqX27EXPiSA2RkeQg=; b=uhqmWJoKf+e5Tjvt0sOKpx/ICe3zDU1poKAZGsLgm5rWjXZHgiaxJG/UosTSSw/y3r hOJpY2qKMXyGptJYd9kqwcmn06xcgZxSGvJAVifCAMAwz9UmiMDRdqNNtcBZrnZput7k aAxf7m1HWxqTQiRtaN162lbyrrV5/64ruygnJ408JUu8xFA7RuoqvdfEhwkInHqQ1JlA /d+luqYZKQuKRyWMncKF0pSdD4kKjB0PBiRz98JDeuOAhTwWpmf1/FbyDVmxpch+tAQk yRlSVhodbFNWOKteMgc03VXUubeelFchts4ag435er4xtV/7Nu6+i5zcok4P4bXlwwSs Pq0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y4si7189839edv.83.2020.11.23.09.47.05 for ; Mon, 23 Nov 2020 09:47:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-scsi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388479AbgKWRpa (ORCPT ); Mon, 23 Nov 2020 12:45:30 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:8572 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730840AbgKWRpa (ORCPT ); Mon, 23 Nov 2020 12:45:30 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CfvgK1c2fzLt6v; Tue, 24 Nov 2020 01:45:01 +0800 (CST) Received: from localhost.localdomain (10.69.192.58) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Tue, 24 Nov 2020 01:45:17 +0800 From: John Garry To: , CC: , , , John Garry Subject: [PATCH 1/3] scsi: hisi_sas: Reduce some indirection in v3 hw driver Date: Tue, 24 Nov 2020 01:41:34 +0800 Message-ID: <1606153296-60088-2-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1606153296-60088-1-git-send-email-john.garry@huawei.com> References: <1606153296-60088-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Sometimes local functions are called indirectly from the hw driver, which only makes the code harder to follow. Remove these. Method .hw_init is only called from platform driver probe, which is not relevant, so don't set this either. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.26.2 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 7133ca859b5e..db409f6847bb 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -3142,7 +3142,6 @@ static struct scsi_host_template sht_v3_hw = { }; static const struct hisi_sas_hw hisi_sas_v3_hw = { - .hw_init = hisi_sas_v3_init, .setup_itct = setup_itct_v3_hw, .get_wideport_bitmap = get_wideport_bitmap_v3_hw, .complete_hdr_size = sizeof(struct hisi_sas_complete_v3_hdr), @@ -3322,7 +3321,7 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (rc) goto err_out_register_ha; - rc = hisi_hba->hw->hw_init(hisi_hba); + rc = hisi_sas_v3_init(hisi_hba); if (rc) goto err_out_register_ha; @@ -3511,7 +3510,7 @@ static int _resume_v3_hw(struct device *device) pci_disable_device(pdev); return rc; } - hisi_hba->hw->phys_init(hisi_hba); + phys_init_v3_hw(hisi_hba); sas_resume_ha(sha); clear_bit(HISI_SAS_RESET_BIT, &hisi_hba->flags);