Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp368181pxb; Fri, 3 Sep 2021 04:07:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2qL+qSf0hmEniHokt4OUpLGfpxhSkE7hqq+p3xZpjqqf8zUHJ+OLJSIWiSa7wm/iELu8N X-Received: by 2002:a17:906:2505:: with SMTP id i5mr3563076ejb.450.1630667272629; Fri, 03 Sep 2021 04:07:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630667272; cv=none; d=google.com; s=arc-20160816; b=stys4dWyzhwMe0H/pkGrQ7eIwz5pTQKAM74S0Y2HP/jwfDfu9rH9Cz47aNYdUWW7Pv 0jjYYgBsiSfB+QoF7fYGXGVH9OvMymAqc9oGRT9le0q4+LBjGNdXpi+O+KqAyP9wp175 N+Gxk8Ekoc8bUfZfqtNwHQz7EEQBOLppQzs26RUF+l6p44WB4EgG+/fOChgTKfCQ+BN+ caafEru8svuNAQou7ewdFSIMOJpu16MNb3s+HN9ALIBi+Hic3wGLqYUgJKwmIhwGjJQZ Nj8Zvu2tzx64VyHJrOU1NBj6YS+xiHMOF0OLQx0oE82oBmJV9mTtoxGzB97vILmi+i28 lM/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=+o34AbSwTndcN1WQ9aZmBgQELGXWRlqwoCqKb/mHLSw=; b=muSe/1iKNXH3GebPpMu03S/x0jFKr6FCkCrzx15QcaH0ZuOV/SsYquPY0AB/YUQajp TAFBnnAmfPBTvFxj7a6Q1SRLW4Zoi8hyIRvdQ8GUITiQ/oo2Yth/LxbYpJRtRITSMFa8 dGpMrLA35HgCEYHo5pt2j5fhZiSN98wHfxk497tqZu7DwzWTbRcKHcM8Q4RetecVKvQe pbIE6g662Rg5IUSNg6j6pknNWU+ZDJxZsnvjUnRbKOT8sbguhuE+B66khcp5ZW2jfqgd GyxwnKt7SzQl26UuyErzXpBRi4GVoqV8DProKJZnA7RUwAo8Q/zi+5fIVdTJknEDLYDt /XBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nb8si5611149ejc.529.2021.09.03.04.07.18; Fri, 03 Sep 2021 04:07:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349124AbhICKda (ORCPT + 99 others); Fri, 3 Sep 2021 06:33:30 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3725 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349004AbhICKd3 (ORCPT ); Fri, 3 Sep 2021 06:33:29 -0400 Received: from fraeml704-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4H1Db40xLXz67W7D; Fri, 3 Sep 2021 18:30:40 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml704-chm.china.huawei.com (10.206.15.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Fri, 3 Sep 2021 12:32:16 +0200 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Fri, 3 Sep 2021 11:32:14 +0100 From: John Garry To: , CC: , , , , John Garry Subject: [PATCH] scsi: libsas: co-locate exports with symbols Date: Fri, 3 Sep 2021 18:27:32 +0800 Message-ID: <1630664852-225115-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is standard practice to co-locate export declarations with the symbol which is being exported. Or at least in the same file - see sas_phy_reset(). Modify libsas to follow this practice consistently. Signed-off-by: John Garry diff --git a/drivers/scsi/libsas/sas_init.c b/drivers/scsi/libsas/sas_init.c index b4b0633f3904..63e987fec937 100644 --- a/drivers/scsi/libsas/sas_init.c +++ b/drivers/scsi/libsas/sas_init.c @@ -147,6 +147,7 @@ int sas_register_ha(struct sas_ha_struct *sas_ha) return error; } +EXPORT_SYMBOL_GPL(sas_register_ha); static void sas_disable_events(struct sas_ha_struct *sas_ha) { @@ -176,6 +177,7 @@ int sas_unregister_ha(struct sas_ha_struct *sas_ha) return 0; } +EXPORT_SYMBOL_GPL(sas_unregister_ha); static int sas_get_linkerrors(struct sas_phy *phy) { @@ -313,6 +315,7 @@ int sas_phy_reset(struct sas_phy *phy, int hard_reset) } return ret; } +EXPORT_SYMBOL_GPL(sas_phy_reset); int sas_set_phy_speed(struct sas_phy *phy, struct sas_phy_linkrates *rates) @@ -701,5 +704,3 @@ MODULE_LICENSE("GPL v2"); module_init(sas_class_init); module_exit(sas_class_exit); -EXPORT_SYMBOL_GPL(sas_register_ha); -EXPORT_SYMBOL_GPL(sas_unregister_ha); diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index ee44a0d7730b..44961cbf1060 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c @@ -201,6 +201,7 @@ int sas_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) cmd->scsi_done(cmd); return 0; } +EXPORT_SYMBOL_GPL(sas_queuecommand); static void sas_eh_finish_cmd(struct scsi_cmnd *cmd) { @@ -511,6 +512,7 @@ int sas_eh_device_reset_handler(struct scsi_cmnd *cmd) return FAILED; } +EXPORT_SYMBOL_GPL(sas_eh_device_reset_handler); int sas_eh_target_reset_handler(struct scsi_cmnd *cmd) { @@ -532,6 +534,7 @@ int sas_eh_target_reset_handler(struct scsi_cmnd *cmd) return FAILED; } +EXPORT_SYMBOL_GPL(sas_eh_target_reset_handler); /* Try to reset a device */ static int try_to_reset_cmd_device(struct scsi_cmnd *cmd) @@ -790,6 +793,7 @@ int sas_ioctl(struct scsi_device *sdev, unsigned int cmd, void __user *arg) return -EINVAL; } +EXPORT_SYMBOL_GPL(sas_ioctl); struct domain_device *sas_find_dev_by_rphy(struct sas_rphy *rphy) { @@ -832,6 +836,7 @@ int sas_target_alloc(struct scsi_target *starget) starget->hostdata = found_dev; return 0; } +EXPORT_SYMBOL_GPL(sas_target_alloc); #define SAS_DEF_QD 256 @@ -860,6 +865,7 @@ int sas_slave_configure(struct scsi_device *scsi_dev) return 0; } +EXPORT_SYMBOL_GPL(sas_slave_configure); int sas_change_queue_depth(struct scsi_device *sdev, int depth) { @@ -872,6 +878,7 @@ int sas_change_queue_depth(struct scsi_device *sdev, int depth) depth = 1; return scsi_change_queue_depth(sdev, depth); } +EXPORT_SYMBOL_GPL(sas_change_queue_depth); int sas_bios_param(struct scsi_device *scsi_dev, struct block_device *bdev, @@ -884,6 +891,7 @@ int sas_bios_param(struct scsi_device *scsi_dev, return 0; } +EXPORT_SYMBOL_GPL(sas_bios_param); /* * Tell an upper layer that it needs to initiate an abort for a given task. @@ -910,6 +918,7 @@ void sas_task_abort(struct sas_task *task) else blk_abort_request(sc->request); } +EXPORT_SYMBOL_GPL(sas_task_abort); int sas_slave_alloc(struct scsi_device *sdev) { @@ -918,6 +927,7 @@ int sas_slave_alloc(struct scsi_device *sdev) return 0; } +EXPORT_SYMBOL_GPL(sas_slave_alloc); void sas_target_destroy(struct scsi_target *starget) { @@ -929,6 +939,7 @@ void sas_target_destroy(struct scsi_target *starget) starget->hostdata = NULL; sas_put_device(found_dev); } +EXPORT_SYMBOL_GPL(sas_target_destroy); #define SAS_STRING_ADDR_SIZE 16 @@ -956,15 +967,3 @@ int sas_request_addr(struct Scsi_Host *shost, u8 *addr) } EXPORT_SYMBOL_GPL(sas_request_addr); -EXPORT_SYMBOL_GPL(sas_queuecommand); -EXPORT_SYMBOL_GPL(sas_target_alloc); -EXPORT_SYMBOL_GPL(sas_slave_configure); -EXPORT_SYMBOL_GPL(sas_change_queue_depth); -EXPORT_SYMBOL_GPL(sas_bios_param); -EXPORT_SYMBOL_GPL(sas_task_abort); -EXPORT_SYMBOL_GPL(sas_phy_reset); -EXPORT_SYMBOL_GPL(sas_eh_device_reset_handler); -EXPORT_SYMBOL_GPL(sas_eh_target_reset_handler); -EXPORT_SYMBOL_GPL(sas_slave_alloc); -EXPORT_SYMBOL_GPL(sas_target_destroy); -EXPORT_SYMBOL_GPL(sas_ioctl); -- 2.26.2