From patchwork Mon Apr 10 17:12:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 9673661 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 99FA360244 for ; Mon, 10 Apr 2017 17:13:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8115B26247 for ; Mon, 10 Apr 2017 17:13:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75F9A26E76; Mon, 10 Apr 2017 17:13:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1D5C26247 for ; Mon, 10 Apr 2017 17:13:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754552AbdDJRNY (ORCPT ); Mon, 10 Apr 2017 13:13:24 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:52121 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753852AbdDJRNU (ORCPT ); Mon, 10 Apr 2017 13:13:20 -0400 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1cxcrA-00015Z-Gy; Mon, 10 Apr 2017 19:12:00 +0200 From: Sebastian Andrzej Siewior To: "Martin K . Petersen" , "James E.J. Bottomley" , linux-scsi@vger.kernel.org Cc: rt@linutronix.de, Lee Duncan , Chris Leech , Chad Dupuis , QLogic-Storage-Upstream@qlogic.com, Johannes Thumshirn , Christoph Hellwig , Andrew Morton , Sebastian Andrzej Siewior Subject: [PATCH 3/5] scsi: bnx2fc: clean up header definitions Date: Mon, 10 Apr 2017 19:12:52 +0200 Message-Id: <20170410171254.30367-4-bigeasy@linutronix.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170410171254.30367-1-bigeasy@linutronix.de> References: <20170410171254.30367-1-bigeasy@linutronix.de> MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - All symbols which are only used within one .c file are marked static and removed from the bnx2fc.h file if possible. - the declarion of bnx2fc_percpu is moved into the header file This patch was only compile-tested due to -ENODEV. Cc: QLogic-Storage-Upstream@qlogic.com Cc: Christoph Hellwig Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/scsi/bnx2fc/bnx2fc.h | 5 +---- drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 19 +++++++++---------- drivers/scsi/bnx2fc/bnx2fc_hwi.c | 6 ++---- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h index 0279cc8de7a0..5b2151e7d894 100644 --- a/drivers/scsi/bnx2fc/bnx2fc.h +++ b/drivers/scsi/bnx2fc/bnx2fc.h @@ -172,6 +172,7 @@ struct bnx2fc_percpu_s { struct list_head work_list; spinlock_t fp_work_lock; }; +DECLARE_PER_CPU(struct bnx2fc_percpu_s, bnx2fc_percpu); struct bnx2fc_fw_stats { u64 fc_crc_cnt; @@ -513,7 +514,6 @@ void bnx2fc_cmd_mgr_free(struct bnx2fc_cmd_mgr *cmgr); void bnx2fc_get_link_state(struct bnx2fc_hba *hba); char *bnx2fc_get_next_rqe(struct bnx2fc_rport *tgt, u8 num_items); void bnx2fc_return_rqe(struct bnx2fc_rport *tgt, u8 num_items); -int bnx2fc_get_paged_crc_eof(struct sk_buff *skb, int tlen); int bnx2fc_send_rrq(struct bnx2fc_cmd *aborted_io_req); int bnx2fc_send_adisc(struct bnx2fc_rport *tgt, struct fc_frame *fp); int bnx2fc_send_logo(struct bnx2fc_rport *tgt, struct fc_frame *fp); @@ -537,7 +537,6 @@ void bnx2fc_init_task(struct bnx2fc_cmd *io_req, void bnx2fc_add_2_sq(struct bnx2fc_rport *tgt, u16 xid); void bnx2fc_ring_doorbell(struct bnx2fc_rport *tgt); int bnx2fc_eh_abort(struct scsi_cmnd *sc_cmd); -int bnx2fc_eh_host_reset(struct scsi_cmnd *sc_cmd); int bnx2fc_eh_target_reset(struct scsi_cmnd *sc_cmd); int bnx2fc_eh_device_reset(struct scsi_cmnd *sc_cmd); void bnx2fc_rport_event_handler(struct fc_lport *lport, @@ -570,8 +569,6 @@ struct fc_seq *bnx2fc_elsct_send(struct fc_lport *lport, u32 did, struct fc_frame *, void *), void *arg, u32 timeout); -void bnx2fc_arm_cq(struct bnx2fc_rport *tgt); -int bnx2fc_process_new_cqes(struct bnx2fc_rport *tgt); void bnx2fc_process_cq_compl(struct bnx2fc_rport *tgt, u16 wqe); struct bnx2fc_rport *bnx2fc_tgt_lookup(struct fcoe_port *port, u32 port_id); diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 329922d51f8a..2f66c2ea093c 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c @@ -49,7 +49,7 @@ struct workqueue_struct *bnx2fc_wq; * Here the io threads are per cpu but the l2 thread is just one */ struct fcoe_percpu_s bnx2fc_global; -DEFINE_SPINLOCK(bnx2fc_global_lock); +static DEFINE_SPINLOCK(bnx2fc_global_lock); static struct cnic_ulp_ops bnx2fc_cnic_cb; static struct libfc_function_template bnx2fc_libfc_fcn_templ; @@ -107,22 +107,22 @@ MODULE_PARM_DESC(debug_logging, "\t\t0x10 - fcoe L2 fame related logs.\n" "\t\t0xff - LOG all messages."); -uint bnx2fc_devloss_tmo; +static uint bnx2fc_devloss_tmo; module_param_named(devloss_tmo, bnx2fc_devloss_tmo, uint, S_IRUGO); MODULE_PARM_DESC(devloss_tmo, " Change devloss_tmo for the remote ports " "attached via bnx2fc."); -uint bnx2fc_max_luns = BNX2FC_MAX_LUN; +static uint bnx2fc_max_luns = BNX2FC_MAX_LUN; module_param_named(max_luns, bnx2fc_max_luns, uint, S_IRUGO); MODULE_PARM_DESC(max_luns, " Change the default max_lun per SCSI host. Default " "0xffff."); -uint bnx2fc_queue_depth; +static uint bnx2fc_queue_depth; module_param_named(queue_depth, bnx2fc_queue_depth, uint, S_IRUGO); MODULE_PARM_DESC(queue_depth, " Change the default queue depth of SCSI devices " "attached via bnx2fc."); -uint bnx2fc_log_fka; +static uint bnx2fc_log_fka; module_param_named(log_fka, bnx2fc_log_fka, uint, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(log_fka, " Print message to kernel log when fcoe is " "initiating a FIP keep alive when debug logging is enabled."); @@ -167,7 +167,7 @@ static void bnx2fc_clean_rx_queue(struct fc_lport *lp) spin_unlock_bh(&bg->fcoe_rx_list.lock); } -int bnx2fc_get_paged_crc_eof(struct sk_buff *skb, int tlen) +static int bnx2fc_get_paged_crc_eof(struct sk_buff *skb, int tlen) { int rc; spin_lock(&bnx2fc_global_lock); @@ -1395,10 +1395,9 @@ static struct bnx2fc_hba *bnx2fc_hba_create(struct cnic_dev *cnic) return NULL; } -static struct bnx2fc_interface * -bnx2fc_interface_create(struct bnx2fc_hba *hba, - struct net_device *netdev, - enum fip_state fip_mode) +static struct bnx2fc_interface *bnx2fc_interface_create(struct bnx2fc_hba *hba, + struct net_device *netdev, + enum fip_state fip_mode) { struct fcoe_ctlr_device *ctlr_dev; struct bnx2fc_interface *interface; diff --git a/drivers/scsi/bnx2fc/bnx2fc_hwi.c b/drivers/scsi/bnx2fc/bnx2fc_hwi.c index 1ed7a1784e15..c2288d6cd217 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_hwi.c +++ b/drivers/scsi/bnx2fc/bnx2fc_hwi.c @@ -14,8 +14,6 @@ #include "bnx2fc.h" -DECLARE_PER_CPU(struct bnx2fc_percpu_s, bnx2fc_percpu); - static void bnx2fc_fastpath_notification(struct bnx2fc_hba *hba, struct fcoe_kcqe *new_cqe_kcqe); static void bnx2fc_process_ofld_cmpl(struct bnx2fc_hba *hba, @@ -980,7 +978,7 @@ void bnx2fc_process_cq_compl(struct bnx2fc_rport *tgt, u16 wqe) spin_unlock_bh(&tgt->tgt_lock); } -void bnx2fc_arm_cq(struct bnx2fc_rport *tgt) +static void bnx2fc_arm_cq(struct bnx2fc_rport *tgt) { struct b577xx_fcoe_rx_doorbell *rx_db = &tgt->rx_db; u32 msg; @@ -1007,7 +1005,7 @@ static struct bnx2fc_work *bnx2fc_alloc_work(struct bnx2fc_rport *tgt, u16 wqe) return work; } -int bnx2fc_process_new_cqes(struct bnx2fc_rport *tgt) +static int bnx2fc_process_new_cqes(struct bnx2fc_rport *tgt) { struct fcoe_cqe *cq; u32 cq_cons;