All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] bfa: fix W=1 build warnings
@ 2016-08-02 15:22 Arnd Bergmann
  2016-08-02 15:22 ` [PATCH 1/5] bfa: mark symbols static where possible Arnd Bergmann
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Arnd Bergmann @ 2016-08-02 15:22 UTC (permalink / raw)
  To: Anil Gurumurthy, Sudarsana Kalluru
  Cc: James E . J . Bottomley, Martin K . Petersen, linux-scsi,
	linux-kernel, Baoyou Xie, Arnd Bergmann

I tried to build an allmodconfig kernel with W=1, and the bfa
driver stuck out for having the most warnings in one file, so
I decided to send patches for all of these and make the driver
build cleanly with the extra warnings enabled.

As most warnings were for functions that lacked a 'static',
I marked them that way, and also used a script to look for
further functions that have a declaration but can also be static.

Overall, this saves around 10% of the size of the driver
module:

   text	   data	    bss	    dec	    hex	filename
 232027	   3012	    976	 236015	  399ef	drivers/scsi/bfa/bfa-before.o
 221851	   2996	    908	 225755	  371db	drivers/scsi/bfa/bfa-after.o

	Arnd

Arnd Bergmann (5):
  bfa: mark symbols static where possible
  bfa: remove unused variables
  bfa: rename some global variables
  bfa: remove unused functions from fbbuild.c
  bfa: remove more unused functions

 drivers/scsi/bfa/bfa.h           |  17 --
 drivers/scsi/bfa/bfa_core.c      |  54 +---
 drivers/scsi/bfa/bfa_fcbuild.c   | 609 +--------------------------------------
 drivers/scsi/bfa/bfa_fcbuild.h   |  90 ------
 drivers/scsi/bfa/bfa_fcpim.c     |  81 +++---
 drivers/scsi/bfa/bfa_fcpim.h     |  26 --
 drivers/scsi/bfa/bfa_fcs.c       |  31 +-
 drivers/scsi/bfa/bfa_fcs.h       |  54 ----
 drivers/scsi/bfa/bfa_fcs_lport.c | 211 +++-----------
 drivers/scsi/bfa/bfa_fcs_rport.c |  48 +--
 drivers/scsi/bfa/bfa_ioc.c       |  83 ++----
 drivers/scsi/bfa/bfa_ioc.h       |  25 --
 drivers/scsi/bfa/bfa_ioc_cb.c    |   3 +-
 drivers/scsi/bfa/bfa_ioc_ct.c    |  12 +-
 drivers/scsi/bfa/bfa_plog.h      |   8 -
 drivers/scsi/bfa/bfa_port.c      |   6 +-
 drivers/scsi/bfa/bfa_port.h      |   1 -
 drivers/scsi/bfa/bfa_svc.c       |  95 ++----
 drivers/scsi/bfa/bfa_svc.h       |  17 --
 drivers/scsi/bfa/bfad.c          | 128 ++++----
 drivers/scsi/bfa/bfad_attr.c     |   9 +-
 drivers/scsi/bfa/bfad_bsg.c      | 224 +++++++-------
 drivers/scsi/bfa/bfad_drv.h      |  49 +---
 drivers/scsi/bfa/bfad_im.c       |  29 +-
 drivers/scsi/bfa/bfad_im.h       |  10 -
 25 files changed, 395 insertions(+), 1525 deletions(-)

-- 
2.9.0

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/5] bfa: mark symbols static where possible
  2016-08-02 15:22 [PATCH 0/5] bfa: fix W=1 build warnings Arnd Bergmann
@ 2016-08-02 15:22 ` Arnd Bergmann
  2016-08-03  4:45     ` kbuild test robot
  2016-08-10  5:20   ` Sudarsana Kalluru
  2016-08-02 15:22 ` [PATCH 2/5] bfa: remove unused variables Arnd Bergmann
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 11+ messages in thread
From: Arnd Bergmann @ 2016-08-02 15:22 UTC (permalink / raw)
  To: Anil Gurumurthy, Sudarsana Kalluru
  Cc: James E . J . Bottomley, Martin K . Petersen, linux-scsi,
	linux-kernel, Baoyou Xie, Arnd Bergmann

We get 128 warnings about global functions without a declaration
in the bfa scsi driver when building with W=1, more than any other
driver, e.g.

bfa/bfad.c:1502:1: error: no previous prototype for 'restart_bfa'
bfa/bfad_attr.c:447:1: error: no previous prototype for 'bfad_im_issue_fc_host_lip'
bfa/bfad_attr.c:575:1: error: no previous prototype for 'bfad_im_vport_set_symbolic_name'
bfa/bfad_bsg.c:27:1: error: no previous prototype for 'bfad_iocmd_ioc_enable'
bfa/bfad_bsg.c:50:1: error: no previous prototype for 'bfad_iocmd_ioc_disable'
bfa/bfad_bsg.c:148:1: error: no previous prototype for 'bfad_iocmd_ioc_get_stats'

In this case, all of those functions are only used in the file in
which they are declared and don't need a declaration, but can be
made static. A little more research reveals many more functions
in this driver that have a declaration but are also used only
in the same file, so this patch marks them all 'static' and moves
the declarations from a header file into the .c file where necessary.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/bfa/bfa.h           |  15 ---
 drivers/scsi/bfa/bfa_core.c      |  19 ++--
 drivers/scsi/bfa/bfa_fcbuild.c   |   2 +-
 drivers/scsi/bfa/bfa_fcbuild.h   |   3 -
 drivers/scsi/bfa/bfa_fcpim.c     |  66 ++++++++----
 drivers/scsi/bfa/bfa_fcpim.h     |  25 -----
 drivers/scsi/bfa/bfa_fcs.c       |  31 ++++--
 drivers/scsi/bfa/bfa_fcs.h       |  41 -------
 drivers/scsi/bfa/bfa_fcs_lport.c |  69 ++++++++----
 drivers/scsi/bfa/bfa_fcs_rport.c |   9 +-
 drivers/scsi/bfa/bfa_ioc.c       |  44 ++++----
 drivers/scsi/bfa/bfa_ioc.h       |  23 ----
 drivers/scsi/bfa/bfa_ioc_cb.c    |   3 +-
 drivers/scsi/bfa/bfa_ioc_ct.c    |  12 ++-
 drivers/scsi/bfa/bfa_plog.h      |   8 --
 drivers/scsi/bfa/bfa_port.c      |   6 +-
 drivers/scsi/bfa/bfa_port.h      |   1 -
 drivers/scsi/bfa/bfa_svc.c       |  38 ++++---
 drivers/scsi/bfa/bfa_svc.h       |  12 ---
 drivers/scsi/bfa/bfad.c          |  88 ++++++++-------
 drivers/scsi/bfa/bfad_attr.c     |   4 +-
 drivers/scsi/bfa/bfad_bsg.c      | 224 +++++++++++++++++++--------------------
 drivers/scsi/bfa/bfad_drv.h      |  44 +-------
 drivers/scsi/bfa/bfad_im.c       |  23 ++--
 drivers/scsi/bfa/bfad_im.h       |  10 --
 25 files changed, 372 insertions(+), 448 deletions(-)

diff --git a/drivers/scsi/bfa/bfa.h b/drivers/scsi/bfa/bfa.h
index 0e119d838e1b..c3b499d126d5 100644
--- a/drivers/scsi/bfa/bfa.h
+++ b/drivers/scsi/bfa/bfa.h
@@ -31,11 +31,6 @@ typedef void (*bfa_isr_func_t) (struct bfa_s *bfa, struct bfi_msg_s *m);
 typedef void (*bfa_cb_cbfn_status_t) (void *cbarg, bfa_status_t status);
 
 /*
- * Interrupt message handlers
- */
-void bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m);
-
-/*
  * Request and response queue related defines
  */
 #define BFA_REQQ_NELEMS_MIN	(4)
@@ -299,19 +294,11 @@ struct bfa_iocfc_s {
 /*
  * FC specific IOC functions.
  */
-void bfa_iocfc_meminfo(struct bfa_iocfc_cfg_s *cfg,
-			struct bfa_meminfo_s *meminfo,
-			struct bfa_s *bfa);
-void bfa_iocfc_attach(struct bfa_s *bfa, void *bfad,
-		      struct bfa_iocfc_cfg_s *cfg,
-		      struct bfa_pcidev_s *pcidev);
 void bfa_iocfc_init(struct bfa_s *bfa);
 void bfa_iocfc_start(struct bfa_s *bfa);
 void bfa_iocfc_stop(struct bfa_s *bfa);
-void bfa_iocfc_isr(void *bfa, struct bfi_mbmsg_s *msg);
 void bfa_iocfc_set_snsbase(struct bfa_s *bfa, int seg_no, u64 snsbase_pa);
 bfa_boolean_t bfa_iocfc_is_operational(struct bfa_s *bfa);
-void bfa_iocfc_reset_queues(struct bfa_s *bfa);
 
 void bfa_msix_all(struct bfa_s *bfa, int vec);
 void bfa_msix_reqq(struct bfa_s *bfa, int vec);
@@ -413,8 +400,6 @@ void bfa_cb_init(void *bfad, bfa_status_t status);
 void bfa_cb_updateq(void *bfad, bfa_status_t status);
 
 bfa_boolean_t bfa_intx(struct bfa_s *bfa);
-void bfa_isr_enable(struct bfa_s *bfa);
-void bfa_isr_disable(struct bfa_s *bfa);
 
 void bfa_comp_deq(struct bfa_s *bfa, struct list_head *comp_q);
 void bfa_comp_process(struct bfa_s *bfa, struct list_head *comp_q);
diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c
index 7209afad82f7..75c6db27a399 100644
--- a/drivers/scsi/bfa/bfa_core.c
+++ b/drivers/scsi/bfa/bfa_core.c
@@ -22,6 +22,11 @@
 
 BFA_TRC_FILE(HAL, CORE);
 
+static void bfa_iocfc_reset_queues(struct bfa_s *bfa);
+static void bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m);
+static void bfa_iocfc_isr(void *bfaarg, struct bfi_mbmsg_s *m);
+static void bfa_isr_disable(struct bfa_s *bfa);
+
 /*
  * BFA module list terminated by NULL
  */
@@ -732,7 +737,7 @@ bfa_reqq_resume(struct bfa_s *bfa, int qid)
 	}
 }
 
-bfa_boolean_t
+static bfa_boolean_t
 bfa_isr_rspq(struct bfa_s *bfa, int qid)
 {
 	struct bfi_msg_s *m;
@@ -864,7 +869,7 @@ bfa_intx(struct bfa_s *bfa)
 	return BFA_TRUE;
 }
 
-void
+static void
 bfa_isr_enable(struct bfa_s *bfa)
 {
 	u32 umsk;
@@ -910,7 +915,7 @@ bfa_msix_reqq(struct bfa_s *bfa, int vec)
 	bfa_isr_reqq(bfa, vec - bfa->iocfc.hwif.cpe_vec_q0);
 }
 
-void
+static void
 bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m)
 {
 	bfa_trc(bfa, m->mhdr.msg_class);
@@ -1328,7 +1333,7 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa)
 	}
 }
 
-void
+static void
 bfa_iocfc_reset_queues(struct bfa_s *bfa)
 {
 	int		q;
@@ -1483,7 +1488,7 @@ bfa_iocfc_reset_cbfn(void *bfa_arg)
 /*
  * Query IOC memory requirement information.
  */
-void
+static void
 bfa_iocfc_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo,
 		  struct bfa_s *bfa)
 {
@@ -1529,7 +1534,7 @@ bfa_iocfc_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo,
 /*
  * Query IOC memory requirement information.
  */
-void
+static void
 bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
 		 struct bfa_pcidev_s *pcidev)
 {
@@ -1591,7 +1596,7 @@ bfa_iocfc_stop(struct bfa_s *bfa)
 	bfa_fsm_send_event(&bfa->iocfc, IOCFC_E_STOP);
 }
 
-void
+static void
 bfa_iocfc_isr(void *bfaarg, struct bfi_mbmsg_s *m)
 {
 	struct bfa_s		*bfa = bfaarg;
diff --git a/drivers/scsi/bfa/bfa_fcbuild.c b/drivers/scsi/bfa/bfa_fcbuild.c
index b8dadc9cc993..baf22632ee96 100644
--- a/drivers/scsi/bfa/bfa_fcbuild.c
+++ b/drivers/scsi/bfa/bfa_fcbuild.c
@@ -172,7 +172,7 @@ fc_gsresp_fchdr_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id)
 	fchs->ox_id = ox_id;
 }
 
-void
+static void
 fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id)
 {
 	memcpy(fchs, &fc_els_req_tmpl, sizeof(struct fchs_s));
diff --git a/drivers/scsi/bfa/bfa_fcbuild.h b/drivers/scsi/bfa/bfa_fcbuild.h
index b109a8813401..433316fa72fa 100644
--- a/drivers/scsi/bfa/bfa_fcbuild.h
+++ b/drivers/scsi/bfa/bfa_fcbuild.h
@@ -273,9 +273,6 @@ u16	fc_gfn_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn);
 
 void		fc_get_fc4type_bitmask(u8 fc4_type, u8 *bit_mask);
 
-void		fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
-					 __be16 ox_id);
-
 enum fc_parse_status	fc_els_rsp_parse(struct fchs_s *fchs, int len);
 
 enum fc_parse_status	fc_plogi_rsp_parse(struct fchs_s *fchs, int len,
diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c
index 20982e7cdd81..2132ab2ca88e 100644
--- a/drivers/scsi/bfa/bfa_fcpim.c
+++ b/drivers/scsi/bfa/bfa_fcpim.c
@@ -179,6 +179,8 @@ static void     bfa_itnim_iotov(void *itnim_arg);
 static void     bfa_itnim_iotov_start(struct bfa_itnim_s *itnim);
 static void     bfa_itnim_iotov_stop(struct bfa_itnim_s *itnim);
 static void     bfa_itnim_iotov_delete(struct bfa_itnim_s *itnim);
+static bfa_boolean_t bfa_itnim_hold_io(struct bfa_itnim_s *itnim);
+
 
 /*
  * forward declaration of ITNIM state machine
@@ -213,6 +215,9 @@ static void     bfa_itnim_sm_fwdelete_qfull(struct bfa_itnim_s *itnim,
 					enum bfa_itnim_event event);
 static void     bfa_itnim_sm_deleting_qfull(struct bfa_itnim_s *itnim,
 					enum bfa_itnim_event event);
+static void	bfa_itnim_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len);
+static void	bfa_itnim_iocdisable(struct bfa_itnim_s *itnim);
+static void	bfa_itnim_attach(struct bfa_fcpim_s *fcpim);
 
 /*
  * forward declaration for BFA IOIM functions
@@ -227,6 +232,13 @@ static void __bfa_cb_ioim_abort(void *cbarg, bfa_boolean_t complete);
 static void __bfa_cb_ioim_failed(void *cbarg, bfa_boolean_t complete);
 static void __bfa_cb_ioim_pathtov(void *cbarg, bfa_boolean_t complete);
 static bfa_boolean_t    bfa_ioim_is_abortable(struct bfa_ioim_s *ioim);
+static void	bfa_ioim_attach(struct bfa_fcpim_s *fcpim);
+static void	bfa_ioim_tov(struct bfa_ioim_s *ioim);
+static void	bfa_ioim_cleanup(struct bfa_ioim_s *ioim);
+static void	bfa_ioim_iocdisable(struct bfa_ioim_s *ioim);
+static void	bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim,
+				      bfa_boolean_t iotov);
+static void	bfa_ioim_free(struct bfa_ioim_s *ioim);
 
 /*
  * forward declaration of BFA IO state machine
@@ -268,6 +280,9 @@ static void     bfa_tskim_cleanup_ios(struct bfa_tskim_s *tskim);
 static bfa_boolean_t bfa_tskim_send(struct bfa_tskim_s *tskim);
 static bfa_boolean_t bfa_tskim_send_abort(struct bfa_tskim_s *tskim);
 static void     bfa_tskim_iocdisable_ios(struct bfa_tskim_s *tskim);
+static void	bfa_tskim_attach(struct bfa_fcpim_s *fcpim);
+static void	bfa_tskim_iocdisable(struct bfa_tskim_s *tskim);
+static void	bfa_tskim_cleanup(struct bfa_tskim_s *tskim);
 
 /*
  * forward declaration of BFA TSKIM state machine
@@ -286,6 +301,11 @@ static void     bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim,
 					enum bfa_tskim_event event);
 static void     bfa_tskim_sm_hcb(struct bfa_tskim_s *tskim,
 					enum bfa_tskim_event event);
+
+static void bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport,
+		void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m));
+static void bfa_iotag_attach(struct bfa_fcp_mod_s *fcp);
+static u16 bfa_fcpim_read_throttle(struct bfa_s *bfa);
 /*
  *  BFA FCP Initiator Mode module
  */
@@ -445,7 +465,7 @@ bfa_fcpim_port_iostats(struct bfa_s *bfa,
 	return BFA_STATUS_OK;
 }
 
-void
+static void
 bfa_ioim_profile_comp(struct bfa_ioim_s *ioim)
 {
 	struct bfa_itnim_latency_s *io_lat =
@@ -462,7 +482,7 @@ bfa_ioim_profile_comp(struct bfa_ioim_s *ioim)
 	io_lat->avg[idx] += val;
 }
 
-void
+static void
 bfa_ioim_profile_start(struct bfa_ioim_s *ioim)
 {
 	ioim->start_time = jiffies;
@@ -1090,19 +1110,19 @@ bfa_itnim_qresume(void *cbarg)
  *  bfa_itnim_public
  */
 
-void
+static void
 bfa_itnim_iodone(struct bfa_itnim_s *itnim)
 {
 	bfa_wc_down(&itnim->wc);
 }
 
-void
+static void
 bfa_itnim_tskdone(struct bfa_itnim_s *itnim)
 {
 	bfa_wc_down(&itnim->wc);
 }
 
-void
+static void
 bfa_itnim_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len)
 {
 	/*
@@ -1111,7 +1131,7 @@ bfa_itnim_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len)
 	*km_len += cfg->fwcfg.num_rports * sizeof(struct bfa_itnim_s);
 }
 
-void
+static void
 bfa_itnim_attach(struct bfa_fcpim_s *fcpim)
 {
 	struct bfa_s	*bfa = fcpim->bfa;
@@ -1146,7 +1166,7 @@ bfa_itnim_attach(struct bfa_fcpim_s *fcpim)
 	bfa_mem_kva_curp(fcp) = (u8 *) itnim;
 }
 
-void
+static void
 bfa_itnim_iocdisable(struct bfa_itnim_s *itnim)
 {
 	bfa_stats(itnim, ioc_disabled);
@@ -1360,7 +1380,7 @@ bfa_itnim_update_del_itn_stats(struct bfa_itnim_s *itnim)
 /*
  * Itnim interrupt processing.
  */
-void
+static void
 bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
 {
 	struct bfa_fcpim_s *fcpim = BFA_FCPIM(bfa);
@@ -1450,7 +1470,7 @@ bfa_itnim_offline(struct bfa_itnim_s *itnim)
  * Return true if itnim is considered offline for holding off IO request.
  * IO is not held if itnim is being deleted.
  */
-bfa_boolean_t
+static bfa_boolean_t
 bfa_itnim_hold_io(struct bfa_itnim_s *itnim)
 {
 	return itnim->fcpim->path_tov && itnim->iotov_active &&
@@ -2714,7 +2734,7 @@ bfa_ioim_is_abortable(struct bfa_ioim_s *ioim)
 	return BFA_TRUE;
 }
 
-void
+static void
 bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim, bfa_boolean_t iotov)
 {
 	/*
@@ -2744,7 +2764,7 @@ bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim, bfa_boolean_t iotov)
 /*
  * Memory allocation and initialization.
  */
-void
+static void
 bfa_ioim_attach(struct bfa_fcpim_s *fcpim)
 {
 	struct bfa_ioim_s		*ioim;
@@ -2893,7 +2913,7 @@ bfa_ioim_good_comp_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
 /*
  * Called by itnim to clean up IO while going offline.
  */
-void
+static void
 bfa_ioim_cleanup(struct bfa_ioim_s *ioim)
 {
 	bfa_trc(ioim->bfa, ioim->iotag);
@@ -2903,7 +2923,7 @@ bfa_ioim_cleanup(struct bfa_ioim_s *ioim)
 	bfa_sm_send_event(ioim, BFA_IOIM_SM_CLEANUP);
 }
 
-void
+static void
 bfa_ioim_cleanup_tm(struct bfa_ioim_s *ioim, struct bfa_tskim_s *tskim)
 {
 	bfa_trc(ioim->bfa, ioim->iotag);
@@ -2916,7 +2936,7 @@ bfa_ioim_cleanup_tm(struct bfa_ioim_s *ioim, struct bfa_tskim_s *tskim)
 /*
  * IOC failure handling.
  */
-void
+static void
 bfa_ioim_iocdisable(struct bfa_ioim_s *ioim)
 {
 	bfa_trc(ioim->bfa, ioim->iotag);
@@ -2927,7 +2947,7 @@ bfa_ioim_iocdisable(struct bfa_ioim_s *ioim)
 /*
  * IO offline TOV popped. Fail the pending IO.
  */
-void
+static void
 bfa_ioim_tov(struct bfa_ioim_s *ioim)
 {
 	bfa_trc(ioim->bfa, ioim->iotag);
@@ -2970,7 +2990,7 @@ bfa_ioim_alloc(struct bfa_s *bfa, struct bfad_ioim_s *dio,
 	return ioim;
 }
 
-void
+static void
 bfa_ioim_free(struct bfa_ioim_s *ioim)
 {
 	struct bfa_fcpim_s *fcpim = ioim->fcpim;
@@ -3489,7 +3509,7 @@ bfa_tskim_iodone(struct bfa_tskim_s *tskim)
 /*
  * Handle IOC h/w failure notification from itnim.
  */
-void
+static void
 bfa_tskim_iocdisable(struct bfa_tskim_s *tskim)
 {
 	tskim->notify = BFA_FALSE;
@@ -3500,7 +3520,7 @@ bfa_tskim_iocdisable(struct bfa_tskim_s *tskim)
 /*
  * Cleanup TM command and associated IOs as part of ITNIM offline.
  */
-void
+static void
 bfa_tskim_cleanup(struct bfa_tskim_s *tskim)
 {
 	tskim->notify = BFA_TRUE;
@@ -3511,7 +3531,7 @@ bfa_tskim_cleanup(struct bfa_tskim_s *tskim)
 /*
  * Memory allocation and initialization.
  */
-void
+static void
 bfa_tskim_attach(struct bfa_fcpim_s *fcpim)
 {
 	struct bfa_tskim_s *tskim;
@@ -3795,7 +3815,7 @@ bfa_fcp_res_recfg(struct bfa_s *bfa, u16 num_ioim_fw, u16 max_ioim_fw)
 	mod->throttle_update_required = 0;
 }
 
-void
+static void
 bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport,
 		void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m))
 {
@@ -3825,7 +3845,7 @@ bfa_itn_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
 		WARN_ON(1);
 }
 
-void
+static void
 bfa_iotag_attach(struct bfa_fcp_mod_s *fcp)
 {
 	struct bfa_iotag_s *iotag;
@@ -3879,7 +3899,7 @@ bfa_fcpim_get_throttle_cfg(struct bfa_s *bfa, u16 drv_cfg_param)
 	return tmp;
 }
 
-bfa_status_t
+static bfa_status_t
 bfa_fcpim_write_throttle(struct bfa_s *bfa, u16 value)
 {
 	if (!bfa_dconf_get_min_cfg(bfa)) {
@@ -3891,7 +3911,7 @@ bfa_fcpim_write_throttle(struct bfa_s *bfa, u16 value)
 	return BFA_STATUS_FAILED;
 }
 
-u16
+static u16
 bfa_fcpim_read_throttle(struct bfa_s *bfa)
 {
 	struct bfa_throttle_cfg_s *throttle_cfg =
diff --git a/drivers/scsi/bfa/bfa_fcpim.h b/drivers/scsi/bfa/bfa_fcpim.h
index e93921dec347..c3dfd26350c2 100644
--- a/drivers/scsi/bfa/bfa_fcpim.h
+++ b/drivers/scsi/bfa/bfa_fcpim.h
@@ -39,10 +39,7 @@ struct bfa_itn_s {
 	bfa_isr_func_t isr;
 };
 
-void bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport,
-		void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m));
 void bfa_itn_isr(struct bfa_s *bfa, struct bfi_msg_s *m);
-void bfa_iotag_attach(struct bfa_fcp_mod_s *fcp);
 void bfa_fcp_res_recfg(struct bfa_s *bfa, u16 num_ioim_fw, u16 max_ioim_fw);
 
 #define BFA_FCP_MOD(_hal)	(&(_hal)->modules.fcp_mod)
@@ -275,31 +272,14 @@ bfa_ioim_maxretry_reached(struct bfa_ioim_s *ioim)
 /*
  * function prototypes
  */
-void	bfa_ioim_attach(struct bfa_fcpim_s *fcpim);
 void	bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
 void	bfa_ioim_good_comp_isr(struct bfa_s *bfa,
 					struct bfi_msg_s *msg);
-void	bfa_ioim_cleanup(struct bfa_ioim_s *ioim);
-void	bfa_ioim_cleanup_tm(struct bfa_ioim_s *ioim,
-					struct bfa_tskim_s *tskim);
-void	bfa_ioim_iocdisable(struct bfa_ioim_s *ioim);
-void	bfa_ioim_tov(struct bfa_ioim_s *ioim);
 
-void	bfa_tskim_attach(struct bfa_fcpim_s *fcpim);
 void	bfa_tskim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
 void	bfa_tskim_iodone(struct bfa_tskim_s *tskim);
-void	bfa_tskim_iocdisable(struct bfa_tskim_s *tskim);
-void	bfa_tskim_cleanup(struct bfa_tskim_s *tskim);
 void	bfa_tskim_res_recfg(struct bfa_s *bfa, u16 num_tskim_fw);
 
-void	bfa_itnim_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len);
-void	bfa_itnim_attach(struct bfa_fcpim_s *fcpim);
-void	bfa_itnim_iocdisable(struct bfa_itnim_s *itnim);
-void	bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
-void	bfa_itnim_iodone(struct bfa_itnim_s *itnim);
-void	bfa_itnim_tskdone(struct bfa_itnim_s *itnim);
-bfa_boolean_t   bfa_itnim_hold_io(struct bfa_itnim_s *itnim);
-
 /*
  * bfa fcpim module API functions
  */
@@ -368,11 +348,8 @@ struct bfa_ioim_s	*bfa_ioim_alloc(struct bfa_s *bfa,
 					struct bfa_itnim_s *itnim,
 					u16 nsgles);
 
-void		bfa_ioim_free(struct bfa_ioim_s *ioim);
 void		bfa_ioim_start(struct bfa_ioim_s *ioim);
 bfa_status_t	bfa_ioim_abort(struct bfa_ioim_s *ioim);
-void		bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim,
-				      bfa_boolean_t iotov);
 /*
  * I/O completion notification.
  *
@@ -421,8 +398,6 @@ bfa_status_t	bfa_fcpim_lunmask_delete(struct bfa_s *bfa, u16 vf_id,
 bfa_status_t	bfa_fcpim_lunmask_add(struct bfa_s *bfa, u16 vf_id,
 				wwn_t *pwwn, wwn_t rpwwn, struct scsi_lun lun);
 bfa_status_t	bfa_fcpim_lunmask_clear(struct bfa_s *bfa);
-u16		bfa_fcpim_read_throttle(struct bfa_s *bfa);
-bfa_status_t	bfa_fcpim_write_throttle(struct bfa_s *bfa, u16 value);
 bfa_status_t	bfa_fcpim_throttle_set(struct bfa_s *bfa, u16 value);
 bfa_status_t	bfa_fcpim_throttle_get(struct bfa_s *bfa, void *buf);
 u16     bfa_fcpim_get_throttle_cfg(struct bfa_s *bfa, u16 drv_cfg_param);
diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
index 1e7e139d71ea..7d50a610d6f8 100644
--- a/drivers/scsi/bfa/bfa_fcs.c
+++ b/drivers/scsi/bfa/bfa_fcs.c
@@ -38,6 +38,15 @@ struct bfa_fcs_mod_s {
 
 #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
 
+static void bfa_fcs_port_attach(struct bfa_fcs_s *fcs);
+static void bfa_fcs_uf_attach(struct bfa_fcs_s *fcs);
+static void bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs);
+static void bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs);
+static void bfa_fcs_fabric_modexit(struct bfa_fcs_s *fcs);
+static void bfa_fcs_fabric_modstop(struct bfa_fcs_s *fcs);
+static void bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric);
+static void bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric);
+
 static struct bfa_fcs_mod_s fcs_modules[] = {
 	{ bfa_fcs_port_attach, NULL, NULL },
 	{ bfa_fcs_uf_attach, NULL, NULL },
@@ -822,7 +831,7 @@ bfa_fcs_fabric_init(struct bfa_fcs_fabric_s *fabric)
 /*
  * Port Symbolic Name Creation for base port.
  */
-void
+static void
 bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric)
 {
 	struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg;
@@ -883,7 +892,7 @@ bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric)
 /*
  * Node Symbolic Name Creation for base port and all vports
  */
-void
+static void
 bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric)
 {
 	struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg;
@@ -1130,7 +1139,7 @@ bfa_fcs_fabric_stop_comp(void *cbarg)
 /*
  * Attach time initialization.
  */
-void
+static void
 bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs)
 {
 	struct bfa_fcs_fabric_s *fabric;
@@ -1158,7 +1167,7 @@ bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs)
 	bfa_fcs_lport_attach(&fabric->bport, fabric->fcs, FC_VF_ID_NULL, NULL);
 }
 
-void
+static void
 bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs)
 {
 	bfa_sm_send_event(&fcs->fabric, BFA_FCS_FABRIC_SM_CREATE);
@@ -1168,7 +1177,7 @@ bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs)
 /*
  *   Module cleanup
  */
-void
+static void
 bfa_fcs_fabric_modexit(struct bfa_fcs_s *fcs)
 {
 	struct bfa_fcs_fabric_s *fabric;
@@ -1186,7 +1195,7 @@ bfa_fcs_fabric_modexit(struct bfa_fcs_s *fcs)
 /*
  * Fabric module stop -- stop FCS actions
  */
-void
+static void
 bfa_fcs_fabric_modstop(struct bfa_fcs_s *fcs)
 {
 	struct bfa_fcs_fabric_s *fabric;
@@ -1213,7 +1222,7 @@ bfa_fcs_fabric_modstart(struct bfa_fcs_s *fcs)
 /*
  *   Link up notification from BFA physical port module.
  */
-void
+static void
 bfa_fcs_fabric_link_up(struct bfa_fcs_fabric_s *fabric)
 {
 	bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
@@ -1223,7 +1232,7 @@ bfa_fcs_fabric_link_up(struct bfa_fcs_fabric_s *fabric)
 /*
  *   Link down notification from BFA physical port module.
  */
-void
+static void
 bfa_fcs_fabric_link_down(struct bfa_fcs_fabric_s *fabric)
 {
 	bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
@@ -1317,7 +1326,7 @@ bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric)
 /*
  *		Unsolicited frame receive handling.
  */
-void
+static void
 bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs,
 		       u16 len)
 {
@@ -1633,7 +1642,7 @@ bfa_fcs_port_event_handler(void *cbarg, enum bfa_port_linkstate event)
 	}
 }
 
-void
+static void
 bfa_fcs_port_attach(struct bfa_fcs_s *fcs)
 {
 	bfa_fcport_event_register(fcs->bfa, bfa_fcs_port_event_handler, fcs);
@@ -1706,7 +1715,7 @@ bfa_fcs_uf_recv(void *cbarg, struct bfa_uf_s *uf)
 	bfa_uf_free(uf);
 }
 
-void
+static void
 bfa_fcs_uf_attach(struct bfa_fcs_s *fcs)
 {
 	bfa_uf_recv_register(fcs->bfa, bfa_fcs_uf_recv, fcs);
diff --git a/drivers/scsi/bfa/bfa_fcs.h b/drivers/scsi/bfa/bfa_fcs.h
index 0f797a55d504..5409a1cfb688 100644
--- a/drivers/scsi/bfa/bfa_fcs.h
+++ b/drivers/scsi/bfa/bfa_fcs.h
@@ -308,16 +308,7 @@ void bfa_fcs_lport_clear_stats(struct bfa_fcs_lport_s *fcs_port);
 enum bfa_port_speed bfa_fcs_lport_get_rport_max_speed(
 			struct bfa_fcs_lport_s *port);
 
-/* MS FCS routines */
-void bfa_fcs_lport_ms_init(struct bfa_fcs_lport_s *port);
-void bfa_fcs_lport_ms_offline(struct bfa_fcs_lport_s *port);
-void bfa_fcs_lport_ms_online(struct bfa_fcs_lport_s *port);
-void bfa_fcs_lport_ms_fabric_rscn(struct bfa_fcs_lport_s *port);
-
 /* FDMI FCS routines */
-void bfa_fcs_lport_fdmi_init(struct bfa_fcs_lport_ms_s *ms);
-void bfa_fcs_lport_fdmi_offline(struct bfa_fcs_lport_ms_s *ms);
-void bfa_fcs_lport_fdmi_online(struct bfa_fcs_lport_ms_s *ms);
 void bfa_fcs_lport_uf_recv(struct bfa_fcs_lport_s *lport, struct fchs_s *fchs,
 				     u16 len);
 void bfa_fcs_lport_attach(struct bfa_fcs_lport_s *lport, struct bfa_fcs_s *fcs,
@@ -328,10 +319,6 @@ void            bfa_fcs_lport_online(struct bfa_fcs_lport_s *port);
 void            bfa_fcs_lport_offline(struct bfa_fcs_lport_s *port);
 void            bfa_fcs_lport_delete(struct bfa_fcs_lport_s *port);
 void		bfa_fcs_lport_stop(struct bfa_fcs_lport_s *port);
-struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_pid(
-		struct bfa_fcs_lport_s *port, u32 pid);
-struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_old_pid(
-		struct bfa_fcs_lport_s *port, u32 pid);
 struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_pwwn(
 		struct bfa_fcs_lport_s *port, wwn_t pwwn);
 struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_nwwn(
@@ -342,17 +329,6 @@ void            bfa_fcs_lport_add_rport(struct bfa_fcs_lport_s *port,
 				       struct bfa_fcs_rport_s *rport);
 void            bfa_fcs_lport_del_rport(struct bfa_fcs_lport_s *port,
 				       struct bfa_fcs_rport_s *rport);
-void            bfa_fcs_lport_ns_init(struct bfa_fcs_lport_s *vport);
-void            bfa_fcs_lport_ns_offline(struct bfa_fcs_lport_s *vport);
-void            bfa_fcs_lport_ns_online(struct bfa_fcs_lport_s *vport);
-void            bfa_fcs_lport_ns_query(struct bfa_fcs_lport_s *port);
-void		bfa_fcs_lport_ns_util_send_rspn_id(void *cbarg,
-				struct bfa_fcxp_s *fcxp_alloced);
-void            bfa_fcs_lport_scn_init(struct bfa_fcs_lport_s *vport);
-void            bfa_fcs_lport_scn_offline(struct bfa_fcs_lport_s *vport);
-void            bfa_fcs_lport_fab_scn_online(struct bfa_fcs_lport_s *vport);
-void            bfa_fcs_lport_scn_process_rscn(struct bfa_fcs_lport_s *port,
-					      struct fchs_s *rx_frame, u32 len);
 void		bfa_fcs_lport_lip_scn_online(bfa_fcs_lport_t *port);
 
 struct bfa_fcs_vport_s {
@@ -391,10 +367,8 @@ struct bfa_fcs_vport_s *bfa_fcs_vport_lookup(struct bfa_fcs_s *fcs,
 void bfa_fcs_vport_cleanup(struct bfa_fcs_vport_s *vport);
 void bfa_fcs_vport_online(struct bfa_fcs_vport_s *vport);
 void bfa_fcs_vport_offline(struct bfa_fcs_vport_s *vport);
-void bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport);
 void bfa_fcs_vport_fcs_delete(struct bfa_fcs_vport_s *vport);
 void bfa_fcs_vport_fcs_stop(struct bfa_fcs_vport_s *vport);
-void bfa_fcs_vport_stop_comp(struct bfa_fcs_vport_s *vport);
 
 #define BFA_FCS_RPORT_DEF_DEL_TIMEOUT	90	/* in secs */
 #define BFA_FCS_RPORT_MAX_RETRIES	(5)
@@ -494,9 +468,6 @@ void bfa_fcs_rport_fcptm_offline_done(struct bfa_fcs_rport_s *rport);
 int  bfa_fcs_rport_get_state(struct bfa_fcs_rport_s *rport);
 struct bfa_fcs_rport_s *bfa_fcs_rport_create_by_wwn(
 			struct bfa_fcs_lport_s *port, wwn_t wwn);
-void  bfa_fcs_rpf_init(struct bfa_fcs_rport_s *rport);
-void  bfa_fcs_rpf_rport_online(struct bfa_fcs_rport_s *rport);
-void  bfa_fcs_rpf_rport_offline(struct bfa_fcs_rport_s *rport);
 
 /*
  * forward declarations
@@ -808,11 +779,6 @@ void bfa_fcs_vf_get_ports(bfa_fcs_vf_t *vf, wwn_t vpwwn[], int *nports);
 /*
  * fabric protected interface functions
  */
-void bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs);
-void bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs);
-void bfa_fcs_fabric_modexit(struct bfa_fcs_s *fcs);
-void bfa_fcs_fabric_link_up(struct bfa_fcs_fabric_s *fabric);
-void bfa_fcs_fabric_link_down(struct bfa_fcs_fabric_s *fabric);
 void bfa_fcs_fabric_addvport(struct bfa_fcs_fabric_s *fabric,
 	struct bfa_fcs_vport_s *vport);
 void bfa_fcs_fabric_delvport(struct bfa_fcs_fabric_s *fabric,
@@ -820,16 +786,9 @@ void bfa_fcs_fabric_delvport(struct bfa_fcs_fabric_s *fabric,
 struct bfa_fcs_vport_s *bfa_fcs_fabric_vport_lookup(
 		struct bfa_fcs_fabric_s *fabric, wwn_t pwwn);
 void bfa_fcs_fabric_modstart(struct bfa_fcs_s *fcs);
-void bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric,
-		struct fchs_s *fchs, u16 len);
-void	bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric);
-void	bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric);
 void bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric,
 	       wwn_t fabric_name);
 u16 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric);
-void bfa_fcs_uf_attach(struct bfa_fcs_s *fcs);
-void bfa_fcs_port_attach(struct bfa_fcs_s *fcs);
-void bfa_fcs_fabric_modstop(struct bfa_fcs_s *fcs);
 void bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric,
 			enum bfa_fcs_fabric_event event);
 void bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric,
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index 7733ad5305d4..7870baedb9bd 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -84,6 +84,28 @@ static void	bfa_fcs_lport_loop_init(struct bfa_fcs_lport_s *port);
 static void	bfa_fcs_lport_loop_online(struct bfa_fcs_lport_s *port);
 static void	bfa_fcs_lport_loop_offline(struct bfa_fcs_lport_s *port);
 
+static void	bfa_fcs_lport_scn_process_rscn(struct bfa_fcs_lport_s *port,
+					       struct fchs_s *fchs, u32 len);
+static void	bfa_fcs_lport_scn_init(struct bfa_fcs_lport_s *port);
+static void	bfa_fcs_lport_scn_offline(struct bfa_fcs_lport_s *port);
+static void	bfa_fcs_lport_fab_scn_online(struct bfa_fcs_lport_s *port);
+
+static void	bfa_fcs_lport_ns_init(struct bfa_fcs_lport_s *port);
+static void	bfa_fcs_lport_ns_offline(struct bfa_fcs_lport_s *port);
+static void	bfa_fcs_lport_ns_online(struct bfa_fcs_lport_s *port);
+static void	bfa_fcs_lport_ns_util_send_rspn_id(void *cbarg,
+					   struct bfa_fcxp_s *fcxp_alloced);
+
+static void	bfa_fcs_lport_ms_init(struct bfa_fcs_lport_s *port);
+static void	bfa_fcs_lport_ms_offline(struct bfa_fcs_lport_s *port);
+static void	bfa_fcs_lport_ms_online(struct bfa_fcs_lport_s *port);
+
+static struct bfa_fcs_rport_s *
+		bfa_fcs_lport_get_rport_by_pid(struct bfa_fcs_lport_s *port,
+					       u32 pid);
+
+static void	bfa_fcs_vport_stop_comp(struct bfa_fcs_vport_s *vport);
+static void	bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport);
 static struct {
 	void		(*init) (struct bfa_fcs_lport_s *port);
 	void		(*online) (struct bfa_fcs_lport_s *port);
@@ -893,7 +915,7 @@ bfa_fcs_lport_uf_recv(struct bfa_fcs_lport_s *lport,
 /*
  *   PID based Lookup for a R-Port in the Port R-Port Queue
  */
-struct bfa_fcs_rport_s *
+static struct bfa_fcs_rport_s *
 bfa_fcs_lport_get_rport_by_pid(struct bfa_fcs_lport_s *port, u32 pid)
 {
 	struct bfa_fcs_rport_s *rport;
@@ -912,7 +934,7 @@ bfa_fcs_lport_get_rport_by_pid(struct bfa_fcs_lport_s *port, u32 pid)
 /*
  * OLD_PID based Lookup for a R-Port in the Port R-Port Queue
  */
-struct bfa_fcs_rport_s *
+static struct bfa_fcs_rport_s *
 bfa_fcs_lport_get_rport_by_old_pid(struct bfa_fcs_lport_s *port, u32 pid)
 {
 	struct bfa_fcs_rport_s *rport;
@@ -1280,7 +1302,7 @@ bfa_fcs_lport_n2n_offline(struct bfa_fcs_lport_s *port)
 	n2n_port->reply_oxid = 0;
 }
 
-void
+static void
 bfa_fcport_get_loop_attr(struct bfa_fcs_lport_s *port)
 {
 	int i = 0, j = 0, bit = 0, alpa_bit = 0;
@@ -1417,7 +1439,7 @@ static void	bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_lport_fdmi_s *fdmi,
 				 struct bfa_fcs_fdmi_hba_attr_s *hba_attr);
 static void	bfa_fcs_fdmi_get_portattr(struct bfa_fcs_lport_fdmi_s *fdmi,
 				  struct bfa_fcs_fdmi_port_attr_s *port_attr);
-u32	bfa_fcs_fdmi_convert_speed(enum bfa_port_speed pport_speed);
+static u32	bfa_fcs_fdmi_convert_speed(enum bfa_port_speed pport_speed);
 
 /*
  *  fcs_fdmi_sm FCS FDMI state machine
@@ -2751,7 +2773,7 @@ bfa_fcs_fdmi_get_portattr(struct bfa_fcs_lport_fdmi_s *fdmi,
 /*
  * Convert BFA speed to FDMI format.
  */
-u32
+static u32
 bfa_fcs_fdmi_convert_speed(bfa_port_speed_t pport_speed)
 {
 	u32	ret;
@@ -2784,7 +2806,7 @@ bfa_fcs_fdmi_convert_speed(bfa_port_speed_t pport_speed)
 	return ret;
 }
 
-void
+static void
 bfa_fcs_lport_fdmi_init(struct bfa_fcs_lport_ms_s *ms)
 {
 	struct bfa_fcs_lport_fdmi_s *fdmi = &ms->fdmi;
@@ -2796,7 +2818,7 @@ bfa_fcs_lport_fdmi_init(struct bfa_fcs_lport_ms_s *ms)
 		bfa_sm_set_state(fdmi, bfa_fcs_lport_fdmi_sm_disabled);
 }
 
-void
+static void
 bfa_fcs_lport_fdmi_offline(struct bfa_fcs_lport_ms_s *ms)
 {
 	struct bfa_fcs_lport_fdmi_s *fdmi = &ms->fdmi;
@@ -2805,7 +2827,7 @@ bfa_fcs_lport_fdmi_offline(struct bfa_fcs_lport_ms_s *ms)
 	bfa_sm_send_event(fdmi, FDMISM_EVENT_PORT_OFFLINE);
 }
 
-void
+static void
 bfa_fcs_lport_fdmi_online(struct bfa_fcs_lport_ms_s *ms)
 {
 	struct bfa_fcs_lport_fdmi_s *fdmi = &ms->fdmi;
@@ -3506,7 +3528,7 @@ bfa_fcs_lport_ms_timeout(void *arg)
 }
 
 
-void
+static void
 bfa_fcs_lport_ms_init(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_ms_s *ms = BFA_FCS_GET_MS_FROM_PORT(port);
@@ -3520,7 +3542,7 @@ bfa_fcs_lport_ms_init(struct bfa_fcs_lport_s *port)
 	bfa_fcs_lport_fdmi_init(ms);
 }
 
-void
+static void
 bfa_fcs_lport_ms_offline(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_ms_s *ms = BFA_FCS_GET_MS_FROM_PORT(port);
@@ -3530,7 +3552,7 @@ bfa_fcs_lport_ms_offline(struct bfa_fcs_lport_s *port)
 	bfa_fcs_lport_fdmi_offline(ms);
 }
 
-void
+static void
 bfa_fcs_lport_ms_online(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_ms_s *ms = BFA_FCS_GET_MS_FROM_PORT(port);
@@ -3538,7 +3560,8 @@ bfa_fcs_lport_ms_online(struct bfa_fcs_lport_s *port)
 	ms->port = port;
 	bfa_sm_send_event(ms, MSSM_EVENT_PORT_ONLINE);
 }
-void
+
+static void
 bfa_fcs_lport_ms_fabric_rscn(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_ms_s *ms = BFA_FCS_GET_MS_FROM_PORT(port);
@@ -5100,7 +5123,7 @@ bfa_fcs_lport_ns_process_gidft_pids(struct bfa_fcs_lport_s *port, u32 *pid_buf,
  * Functions called by port/fab.
  * These will send relevant Events to the ns state machine.
  */
-void
+static void
 bfa_fcs_lport_ns_init(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_ns_s *ns = BFA_FCS_GET_NS_FROM_PORT(port);
@@ -5109,7 +5132,7 @@ bfa_fcs_lport_ns_init(struct bfa_fcs_lport_s *port)
 	bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_offline);
 }
 
-void
+static void
 bfa_fcs_lport_ns_offline(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_ns_s *ns = BFA_FCS_GET_NS_FROM_PORT(port);
@@ -5118,7 +5141,7 @@ bfa_fcs_lport_ns_offline(struct bfa_fcs_lport_s *port)
 	bfa_sm_send_event(ns, NSSM_EVENT_PORT_OFFLINE);
 }
 
-void
+static void
 bfa_fcs_lport_ns_online(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_ns_s *ns = BFA_FCS_GET_NS_FROM_PORT(port);
@@ -5127,7 +5150,7 @@ bfa_fcs_lport_ns_online(struct bfa_fcs_lport_s *port)
 	bfa_sm_send_event(ns, NSSM_EVENT_PORT_ONLINE);
 }
 
-void
+static void
 bfa_fcs_lport_ns_query(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_ns_s *ns = BFA_FCS_GET_NS_FROM_PORT(port);
@@ -5154,7 +5177,7 @@ bfa_fcs_lport_ns_boot_target_disc(bfa_fcs_lport_t *port)
 	}
 }
 
-void
+static void
 bfa_fcs_lport_ns_util_send_rspn_id(void *cbarg, struct bfa_fcxp_s *fcxp_alloced)
 {
 	struct bfa_fcs_lport_ns_s *ns = cbarg;
@@ -5518,7 +5541,7 @@ bfa_fcs_lport_scn_timeout(void *arg)
 /*
  * Functions called by port/fab
  */
-void
+static void
 bfa_fcs_lport_scn_init(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_scn_s *scn = BFA_FCS_GET_SCN_FROM_PORT(port);
@@ -5527,7 +5550,7 @@ bfa_fcs_lport_scn_init(struct bfa_fcs_lport_s *port)
 	bfa_sm_set_state(scn, bfa_fcs_lport_scn_sm_offline);
 }
 
-void
+static void
 bfa_fcs_lport_scn_offline(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_scn_s *scn = BFA_FCS_GET_SCN_FROM_PORT(port);
@@ -5536,7 +5559,7 @@ bfa_fcs_lport_scn_offline(struct bfa_fcs_lport_s *port)
 	bfa_sm_send_event(scn, SCNSM_EVENT_PORT_OFFLINE);
 }
 
-void
+static void
 bfa_fcs_lport_fab_scn_online(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_scn_s *scn = BFA_FCS_GET_SCN_FROM_PORT(port);
@@ -5621,7 +5644,7 @@ bfa_fcs_lport_scn_multiport_rscn(struct bfa_fcs_lport_s *port,
 }
 
 
-void
+static void
 bfa_fcs_lport_scn_process_rscn(struct bfa_fcs_lport_s *port,
 			struct fchs_s *fchs, u32 len)
 {
@@ -6680,7 +6703,7 @@ bfa_fcs_vport_fcs_delete(struct bfa_fcs_vport_s *vport)
 /*
  * Stop completion callback from associated lport
  */
-void
+static void
 bfa_fcs_vport_stop_comp(struct bfa_fcs_vport_s *vport)
 {
 	bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_STOPCOMP);
@@ -6689,7 +6712,7 @@ bfa_fcs_vport_stop_comp(struct bfa_fcs_vport_s *vport)
 /*
  * Delete completion callback from associated lport
  */
-void
+static void
 bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport)
 {
 	bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_DELCOMP);
diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c
index de50349a39ce..1d722e272f18 100644
--- a/drivers/scsi/bfa/bfa_fcs_rport.c
+++ b/drivers/scsi/bfa/bfa_fcs_rport.c
@@ -143,6 +143,9 @@ static void	bfa_fcs_rport_sm_fc4_off_delete(struct bfa_fcs_rport_s *rport,
 						enum rport_event event);
 static void	bfa_fcs_rport_sm_delete_pending(struct bfa_fcs_rport_s *rport,
 						enum rport_event event);
+static void bfa_fcs_rpf_init(struct bfa_fcs_rport_s *rport);
+static void bfa_fcs_rpf_rport_online(struct bfa_fcs_rport_s *rport);
+static void bfa_fcs_rpf_rport_offline(struct bfa_fcs_rport_s *rport);
 
 static struct bfa_sm_table_s rport_sm_table[] = {
 	{BFA_SM(bfa_fcs_rport_sm_uninit), BFA_RPORT_UNINIT},
@@ -3321,7 +3324,7 @@ bfa_fcs_rpf_sm_offline(struct bfa_fcs_rpf_s *rpf, enum rpf_event event)
 /*
  * Called when Rport is created.
  */
-void
+static void
 bfa_fcs_rpf_init(struct bfa_fcs_rport_s *rport)
 {
 	struct bfa_fcs_rpf_s *rpf = &rport->rpf;
@@ -3335,7 +3338,7 @@ bfa_fcs_rpf_init(struct bfa_fcs_rport_s *rport)
 /*
  * Called when Rport becomes online
  */
-void
+static void
 bfa_fcs_rpf_rport_online(struct bfa_fcs_rport_s *rport)
 {
 	bfa_trc(rport->fcs, rport->pid);
@@ -3350,7 +3353,7 @@ bfa_fcs_rpf_rport_online(struct bfa_fcs_rport_s *rport)
 /*
  * Called when Rport becomes offline
  */
-void
+static void
 bfa_fcs_rpf_rport_offline(struct bfa_fcs_rport_s *rport)
 {
 	bfa_trc(rport->fcs, rport->pid);
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index a1ada4a31c97..d2974797e52d 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -118,6 +118,14 @@ static enum bfi_ioc_img_ver_cmp_e bfa_ioc_fw_ver_patch_cmp(
 static enum bfi_ioc_img_ver_cmp_e bfa_ioc_flash_fwver_cmp(
 				struct bfa_ioc_s *ioc,
 				struct bfi_ioc_image_hdr_s *base_fwhdr);
+static void bfa_ioc_aen_post(struct bfa_ioc_s *ioc,
+			     enum bfa_ioc_aen_event event);
+static bfa_status_t bfa_ioc_boot(struct bfa_ioc_s *ioc, u32 boot_type,
+				 u32 boot_env);
+static bfa_status_t bfa_flash_raw_read(void __iomem *pci_bar, u32 offset,
+				       char *buf, u32 len);
+static void bfa_phy_intr(void *phyarg, struct bfi_mbmsg_s *msg);
+static void bfa_fru_intr(void *fruarg, struct bfi_mbmsg_s *msg);
 
 /*
  * IOC state machine definitions/declarations
@@ -1638,7 +1646,7 @@ bfa_ioc_fw_ver_patch_cmp(struct bfi_ioc_image_hdr_s *base_fwhdr,
 
 #define BFA_FLASH_PART_FWIMG_ADDR	0x100000 /* fw image address */
 
-bfa_status_t
+static bfa_status_t
 bfa_ioc_flash_img_get_chnk(struct bfa_ioc_s *ioc, u32 off,
 				u32 *fwimg)
 {
@@ -2192,7 +2200,7 @@ bfa_ioc_pf_fwmismatch(struct bfa_ioc_s *ioc)
 	bfa_ioc_aen_post(ioc, BFA_IOC_AEN_FWMISMATCH);
 }
 
-bfa_status_t
+static bfa_status_t
 bfa_ioc_pll_init(struct bfa_ioc_s *ioc)
 {
 
@@ -2223,7 +2231,7 @@ bfa_ioc_pll_init(struct bfa_ioc_s *ioc)
  * Interface used by diag module to do firmware boot with memory test
  * as the entry vector.
  */
-bfa_status_t
+static bfa_status_t
 bfa_ioc_boot(struct bfa_ioc_s *ioc, u32 boot_type, u32 boot_env)
 {
 	struct bfi_ioc_image_hdr_s *drv_fwhdr;
@@ -2297,7 +2305,7 @@ bfa_ioc_is_initialized(struct bfa_ioc_s *ioc)
 		(r32 != BFI_IOC_MEMTEST));
 }
 
-bfa_boolean_t
+static bfa_boolean_t
 bfa_ioc_msgget(struct bfa_ioc_s *ioc, void *mbmsg)
 {
 	__be32	*msgp = mbmsg;
@@ -2327,7 +2335,7 @@ bfa_ioc_msgget(struct bfa_ioc_s *ioc, void *mbmsg)
 	return BFA_TRUE;
 }
 
-void
+static void
 bfa_ioc_isr(struct bfa_ioc_s *ioc, struct bfi_mbmsg_s *m)
 {
 	union bfi_ioc_i2h_msg_u	*msg;
@@ -2667,7 +2675,7 @@ bfa_ioc_fw_mismatch(struct bfa_ioc_s *ioc)
  * Check if adapter is disabled -- both IOCs should be in a disabled
  * state.
  */
-bfa_boolean_t
+static bfa_boolean_t
 bfa_ioc_adapter_is_disabled(struct bfa_ioc_s *ioc)
 {
 	u32	ioc_state;
@@ -2691,7 +2699,7 @@ bfa_ioc_adapter_is_disabled(struct bfa_ioc_s *ioc)
 /*
  * Reset IOC fwstate registers.
  */
-void
+static void
 bfa_ioc_reset_fwstate(struct bfa_ioc_s *ioc)
 {
 	bfa_ioc_set_cur_ioc_fwstate(ioc, BFI_IOC_UNINIT);
@@ -2699,7 +2707,7 @@ bfa_ioc_reset_fwstate(struct bfa_ioc_s *ioc)
 }
 
 #define BFA_MFG_NAME "QLogic"
-void
+static void
 bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc,
 			 struct bfa_adapter_attr_s *ad_attr)
 {
@@ -2826,7 +2834,7 @@ bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model)
 			BFA_MFG_NAME, ioc_attr->card_type);
 }
 
-enum bfa_ioc_state
+static enum bfa_ioc_state
 bfa_ioc_get_state(struct bfa_ioc_s *ioc)
 {
 	enum bfa_iocpf_state iocpf_st;
@@ -2917,7 +2925,7 @@ bfa_ioc_get_mfg_mac(struct bfa_ioc_s *ioc)
 /*
  * Send AEN notification
  */
-void
+static void
 bfa_ioc_aen_post(struct bfa_ioc_s *ioc, enum bfa_ioc_aen_event event)
 {
 	struct bfad_s *bfad = (struct bfad_s *)ioc->bfa->bfad;
@@ -3996,7 +4004,7 @@ bfa_sfp_speed_valid(struct bfa_sfp_s *sfp, enum bfa_port_speed portspeed)
 /*
  *	SFP hmbox handler
  */
-void
+static void
 bfa_sfp_intr(void *sfparg, struct bfi_mbmsg_s *msg)
 {
 	struct bfa_sfp_s *sfp = sfparg;
@@ -5036,7 +5044,7 @@ diag_portbeacon_comp(struct bfa_diag_s *diag)
 /*
  *	Diag hmbox handler
  */
-void
+static void
 bfa_diag_intr(void *diagarg, struct bfi_mbmsg_s *msg)
 {
 	struct bfa_diag_s *diag = diagarg;
@@ -5515,7 +5523,7 @@ bfa_phy_memclaim(struct bfa_phy_s *phy, u8 *dm_kva, u64 dm_pa,
 	dm_pa += BFA_ROUNDUP(BFA_PHY_DMA_BUF_SZ, BFA_DMA_ALIGN_SZ);
 }
 
-bfa_boolean_t
+static bfa_boolean_t
 bfa_phy_busy(struct bfa_ioc_s *ioc)
 {
 	void __iomem	*rb;
@@ -5710,7 +5718,7 @@ bfa_phy_read(struct bfa_phy_s *phy, u8 instance,
  * @param[in] phyarg - phy structure
  * @param[in] msg - message structure
  */
-void
+static void
 bfa_phy_intr(void *phyarg, struct bfi_mbmsg_s *msg)
 {
 	struct bfa_phy_s *phy = phyarg;
@@ -6582,7 +6590,7 @@ bfa_tfru_read(struct bfa_fru_s *fru, void *buf, u32 len, u32 offset,
  * @param[in] fruarg - fru structure
  * @param[in] msg - message structure
  */
-void
+static void
 bfa_fru_intr(void *fruarg, struct bfi_mbmsg_s *msg)
 {
 	struct bfa_fru_s *fru = fruarg;
@@ -6999,7 +7007,7 @@ bfa_raw_sem_get(void __iomem *bar)
 
 }
 
-bfa_status_t
+static bfa_status_t
 bfa_flash_sem_get(void __iomem *bar)
 {
 	u32 n = FLASH_BLOCKING_OP_MAX;
@@ -7012,13 +7020,13 @@ bfa_flash_sem_get(void __iomem *bar)
 	return BFA_STATUS_OK;
 }
 
-void
+static void
 bfa_flash_sem_put(void __iomem *bar)
 {
 	writel(0, (bar + FLASH_SEM_LOCK_REG));
 }
 
-bfa_status_t
+static bfa_status_t
 bfa_flash_raw_read(void __iomem *pci_bar, u32 offset, char *buf,
 		       u32 len)
 {
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h
index 713745da44c6..a2df03dc420a 100644
--- a/drivers/scsi/bfa/bfa_ioc.h
+++ b/drivers/scsi/bfa/bfa_ioc.h
@@ -454,7 +454,6 @@ void	bfa_sfp_attach(struct bfa_sfp_s *sfp, struct bfa_ioc_s *ioc,
 			void *dev, struct bfa_trc_mod_s *trcmod);
 
 void	bfa_sfp_memclaim(struct bfa_sfp_s *diag, u8 *dm_kva, u64 dm_pa);
-void	bfa_sfp_intr(void *bfaarg, struct bfi_mbmsg_s *msg);
 
 bfa_status_t	bfa_sfp_show(struct bfa_sfp_s *sfp, struct sfp_mem_s *sfpmem,
 			     bfa_cb_sfp_t cbfn, void *cbarg);
@@ -516,8 +515,6 @@ void bfa_flash_attach(struct bfa_flash_s *flash, struct bfa_ioc_s *ioc,
 		void *dev, struct bfa_trc_mod_s *trcmod, bfa_boolean_t mincfg);
 void bfa_flash_memclaim(struct bfa_flash_s *flash,
 		u8 *dm_kva, u64 dm_pa, bfa_boolean_t mincfg);
-bfa_status_t    bfa_flash_raw_read(void __iomem *pci_bar_kva,
-				u32 offset, char *buf, u32 len);
 
 /*
  *	DIAG module specific
@@ -689,7 +686,6 @@ struct bfa_phy_s {
 #define BFA_PHY(__bfa)	(&(__bfa)->modules.phy)
 #define BFA_MEM_PHY_DMA(__bfa)	(&(BFA_PHY(__bfa)->phy_dma))
 
-bfa_boolean_t bfa_phy_busy(struct bfa_ioc_s *ioc);
 bfa_status_t bfa_phy_get_attr(struct bfa_phy_s *phy, u8 instance,
 			struct bfa_phy_attr_s *attr,
 			bfa_cb_phy_t cbfn, void *cbarg);
@@ -708,7 +704,6 @@ void bfa_phy_attach(struct bfa_phy_s *phy, struct bfa_ioc_s *ioc,
 		void *dev, struct bfa_trc_mod_s *trcmod, bfa_boolean_t mincfg);
 void bfa_phy_memclaim(struct bfa_phy_s *phy,
 		u8 *dm_kva, u64 dm_pa, bfa_boolean_t mincfg);
-void bfa_phy_intr(void *phyarg, struct bfi_mbmsg_s *msg);
 
 /*
  * FRU module specific
@@ -758,7 +753,6 @@ void bfa_fru_attach(struct bfa_fru_s *fru, struct bfa_ioc_s *ioc,
 		void *dev, struct bfa_trc_mod_s *trcmod, bfa_boolean_t mincfg);
 void bfa_fru_memclaim(struct bfa_fru_s *fru,
 		u8 *dm_kva, u64 dm_pa, bfa_boolean_t mincfg);
-void bfa_fru_intr(void *fruarg, struct bfi_mbmsg_s *msg);
 
 /*
  * Driver Config( dconf) specific
@@ -845,7 +839,6 @@ void bfa_ioc_mbox_register(struct bfa_ioc_s *ioc,
 		bfa_ioc_mbox_mcfunc_t *mcfuncs);
 void bfa_ioc_mbox_isr(struct bfa_ioc_s *ioc);
 void bfa_ioc_mbox_send(struct bfa_ioc_s *ioc, void *ioc_msg, int len);
-bfa_boolean_t bfa_ioc_msgget(struct bfa_ioc_s *ioc, void *mbmsg);
 void bfa_ioc_mbox_regisr(struct bfa_ioc_s *ioc, enum bfi_mclass mc,
 		bfa_ioc_mbox_mcfunc_t cbfn, void *cbarg);
 
@@ -857,11 +850,6 @@ void bfa_ioc_mbox_regisr(struct bfa_ioc_s *ioc, enum bfi_mclass mc,
 	((__ioc)->ioc_hwif->ioc_pll_init((__ioc)->pcidev.pci_bar_kva, \
 			   (__ioc)->asic_mode))
 
-bfa_status_t bfa_ioc_pll_init(struct bfa_ioc_s *ioc);
-bfa_status_t bfa_ioc_cb_pll_init(void __iomem *rb, enum bfi_asic_mode mode);
-bfa_status_t bfa_ioc_ct_pll_init(void __iomem *rb, enum bfi_asic_mode mode);
-bfa_status_t bfa_ioc_ct2_pll_init(void __iomem *rb, enum bfi_asic_mode mode);
-
 #define bfa_ioc_isr_mode_set(__ioc, __msix) do {			\
 	if ((__ioc)->ioc_hwif->ioc_isr_mode_set)			\
 		((__ioc)->ioc_hwif->ioc_isr_mode_set(__ioc, __msix));	\
@@ -891,17 +879,12 @@ void bfa_ioc_enable(struct bfa_ioc_s *ioc);
 void bfa_ioc_disable(struct bfa_ioc_s *ioc);
 bfa_boolean_t bfa_ioc_intx_claim(struct bfa_ioc_s *ioc);
 
-bfa_status_t bfa_ioc_boot(struct bfa_ioc_s *ioc, u32 boot_type,
-		u32 boot_env);
-void bfa_ioc_isr(struct bfa_ioc_s *ioc, struct bfi_mbmsg_s *msg);
 void bfa_ioc_error_isr(struct bfa_ioc_s *ioc);
 bfa_boolean_t bfa_ioc_is_operational(struct bfa_ioc_s *ioc);
 bfa_boolean_t bfa_ioc_is_initialized(struct bfa_ioc_s *ioc);
 bfa_boolean_t bfa_ioc_is_disabled(struct bfa_ioc_s *ioc);
 bfa_boolean_t bfa_ioc_is_acq_addr(struct bfa_ioc_s *ioc);
 bfa_boolean_t bfa_ioc_fw_mismatch(struct bfa_ioc_s *ioc);
-bfa_boolean_t bfa_ioc_adapter_is_disabled(struct bfa_ioc_s *ioc);
-void bfa_ioc_reset_fwstate(struct bfa_ioc_s *ioc);
 enum bfa_ioc_type_e bfa_ioc_get_type(struct bfa_ioc_s *ioc);
 void bfa_ioc_get_adapter_serial_num(struct bfa_ioc_s *ioc, char *serial_num);
 void bfa_ioc_get_adapter_fw_ver(struct bfa_ioc_s *ioc, char *fw_ver);
@@ -910,11 +893,8 @@ void bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model);
 void bfa_ioc_get_adapter_manufacturer(struct bfa_ioc_s *ioc,
 		char *manufacturer);
 void bfa_ioc_get_pci_chip_rev(struct bfa_ioc_s *ioc, char *chip_rev);
-enum bfa_ioc_state bfa_ioc_get_state(struct bfa_ioc_s *ioc);
 
 void bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr);
-void bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc,
-		struct bfa_adapter_attr_s *ad_attr);
 void bfa_ioc_debug_memclaim(struct bfa_ioc_s *ioc, void *dbg_fwsave);
 bfa_status_t bfa_ioc_debug_fwsave(struct bfa_ioc_s *ioc, void *trcdata,
 		int *trclen);
@@ -928,7 +908,6 @@ void bfa_ioc_fwver_get(struct bfa_ioc_s *ioc,
 			struct bfi_ioc_image_hdr_s *fwhdr);
 bfa_boolean_t bfa_ioc_fwver_cmp(struct bfa_ioc_s *ioc,
 			struct bfi_ioc_image_hdr_s *fwhdr);
-void bfa_ioc_aen_post(struct bfa_ioc_s *ioc, enum bfa_ioc_aen_event event);
 bfa_status_t bfa_ioc_fw_stats_get(struct bfa_ioc_s *ioc, void *stats);
 bfa_status_t bfa_ioc_fw_stats_clear(struct bfa_ioc_s *ioc);
 void bfa_ioc_debug_save_ftrc(struct bfa_ioc_s *ioc);
@@ -960,8 +939,6 @@ bfa_status_t bfa_ablk_optrom_en(struct bfa_ablk_s *ablk,
 bfa_status_t bfa_ablk_optrom_dis(struct bfa_ablk_s *ablk,
 		bfa_ablk_cbfn_t cbfn, void *cbarg);
 
-bfa_status_t bfa_ioc_flash_img_get_chnk(struct bfa_ioc_s *ioc, u32 off,
-				u32 *fwimg);
 /*
  * bfa mfg wwn API functions
  */
diff --git a/drivers/scsi/bfa/bfa_ioc_cb.c b/drivers/scsi/bfa/bfa_ioc_cb.c
index f1b80da298c8..f1fc469d60cc 100644
--- a/drivers/scsi/bfa/bfa_ioc_cb.c
+++ b/drivers/scsi/bfa/bfa_ioc_cb.c
@@ -46,6 +46,7 @@ static enum bfi_ioc_state bfa_ioc_cb_get_cur_ioc_fwstate(struct bfa_ioc_s *ioc);
 static void bfa_ioc_cb_set_alt_ioc_fwstate(
 			struct bfa_ioc_s *ioc, enum bfi_ioc_state fwstate);
 static enum bfi_ioc_state bfa_ioc_cb_get_alt_ioc_fwstate(struct bfa_ioc_s *ioc);
+static bfa_status_t bfa_ioc_cb_pll_init(void __iomem *rb, enum bfi_asic_mode fcmode);
 
 static struct bfa_ioc_hwif_s hwif_cb;
 
@@ -361,7 +362,7 @@ bfa_ioc_cb_sync_complete(struct bfa_ioc_s *ioc)
 	}
 }
 
-bfa_status_t
+static bfa_status_t
 bfa_ioc_cb_pll_init(void __iomem *rb, enum bfi_asic_mode fcmode)
 {
 	u32	pll_sclk, pll_fclk, join_bits;
diff --git a/drivers/scsi/bfa/bfa_ioc_ct.c b/drivers/scsi/bfa/bfa_ioc_ct.c
index 651a8fb93037..12a9529b525f 100644
--- a/drivers/scsi/bfa/bfa_ioc_ct.c
+++ b/drivers/scsi/bfa/bfa_ioc_ct.c
@@ -50,6 +50,10 @@ static enum bfi_ioc_state bfa_ioc_ct_get_cur_ioc_fwstate(struct bfa_ioc_s *ioc);
 static void bfa_ioc_ct_set_alt_ioc_fwstate(
 			struct bfa_ioc_s *ioc, enum bfi_ioc_state fwstate);
 static enum bfi_ioc_state bfa_ioc_ct_get_alt_ioc_fwstate(struct bfa_ioc_s *ioc);
+static bfa_status_t bfa_ioc_ct_pll_init(void __iomem *rb,
+					enum bfi_asic_mode mode);
+static bfa_status_t bfa_ioc_ct2_pll_init(void __iomem *rb,
+					 enum bfi_asic_mode mode);
 
 static struct bfa_ioc_hwif_s hwif_ct;
 static struct bfa_ioc_hwif_s hwif_ct2;
@@ -372,7 +376,7 @@ bfa_ioc_ct_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t msix)
 	writel(r32, rb + FNC_PERS_REG);
 }
 
-bfa_boolean_t
+static bfa_boolean_t
 bfa_ioc_ct2_lpu_read_stat(struct bfa_ioc_s *ioc)
 {
 	u32	r32;
@@ -586,7 +590,7 @@ bfa_ioc_ct2_poweron(struct bfa_ioc_s *ioc)
 		rb + HOSTFN_MSIX_VT_INDEX_MBOX_ERR);
 }
 
-bfa_status_t
+static bfa_status_t
 bfa_ioc_ct_pll_init(void __iomem *rb, enum bfi_asic_mode mode)
 {
 	u32	pll_sclk, pll_fclk, r32;
@@ -752,7 +756,7 @@ bfa_ioc_ct2_mem_init(void __iomem *rb)
 	writel(0, (rb + CT2_MBIST_CTL_REG));
 }
 
-void
+static void
 bfa_ioc_ct2_mac_reset(void __iomem *rb)
 {
 	/* put port0, port1 MAC & AHB in reset */
@@ -892,7 +896,7 @@ bfa_ioc_ct2_wait_till_nfc_running(void __iomem *rb)
 	WARN_ON(!(r32 == CT2_NFC_STATE_RUNNING));
 }
 
-bfa_status_t
+static bfa_status_t
 bfa_ioc_ct2_pll_init(void __iomem *rb, enum bfi_asic_mode mode)
 {
 	u32 wgn, r32, nfc_ver;
diff --git a/drivers/scsi/bfa/bfa_plog.h b/drivers/scsi/bfa/bfa_plog.h
index da570c0b8275..57c27f14a4f6 100644
--- a/drivers/scsi/bfa/bfa_plog.h
+++ b/drivers/scsi/bfa/bfa_plog.h
@@ -144,13 +144,5 @@ struct bfa_plog_s {
 void bfa_plog_init(struct bfa_plog_s *plog);
 void bfa_plog_str(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
 			enum bfa_plog_eid event, u16 misc, char *log_str);
-void bfa_plog_intarr(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
-			enum bfa_plog_eid event, u16 misc,
-			u32 *intarr, u32 num_ints);
-void bfa_plog_fchdr(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
-		enum bfa_plog_eid event, u16 misc, struct fchs_s *fchdr);
-void bfa_plog_fchdr_and_pl(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
-			enum bfa_plog_eid event, u16 misc,
-			struct fchs_s *fchdr, u32 pld_w0);
 
 #endif /* __BFA_PORTLOG_H__ */
diff --git a/drivers/scsi/bfa/bfa_port.c b/drivers/scsi/bfa/bfa_port.c
index da1721e0d167..fa59395a5257 100644
--- a/drivers/scsi/bfa/bfa_port.c
+++ b/drivers/scsi/bfa/bfa_port.c
@@ -419,7 +419,7 @@ bfa_port_clear_stats(struct bfa_port_s *port, bfa_port_stats_cbfn_t cbfn,
  *
  * @return void
  */
-void
+static void
 bfa_port_notify(void *arg, enum bfa_ioc_event_e event)
 {
 	struct bfa_port_s *port = (struct bfa_port_s *) arg;
@@ -773,7 +773,7 @@ bfa_cee_reset_stats(struct bfa_cee_s *cee,
  * @return void
  */
 
-void
+static void
 bfa_cee_isr(void *cbarg, struct bfi_mbmsg_s *m)
 {
 	union bfi_cee_i2h_msg_u *msg;
@@ -809,7 +809,7 @@ bfa_cee_isr(void *cbarg, struct bfi_mbmsg_s *m)
  * @return void
  */
 
-void
+static void
 bfa_cee_notify(void *arg, enum bfa_ioc_event_e event)
 {
 	struct bfa_cee_s *cee = (struct bfa_cee_s *) arg;
diff --git a/drivers/scsi/bfa/bfa_port.h b/drivers/scsi/bfa/bfa_port.h
index 26dc1bf14c85..6587bcf064da 100644
--- a/drivers/scsi/bfa/bfa_port.h
+++ b/drivers/scsi/bfa/bfa_port.h
@@ -54,7 +54,6 @@ struct bfa_port_s {
 
 void	     bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc,
 				void *dev, struct bfa_trc_mod_s *trcmod);
-void	bfa_port_notify(void *arg, enum bfa_ioc_event_e event);
 
 bfa_status_t bfa_port_get_stats(struct bfa_port_s *port,
 				 union bfa_port_stats_u *stats,
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index 12de292175ef..5345ebb81646 100644
--- a/drivers/scsi/bfa/bfa_svc.c
+++ b/drivers/scsi/bfa/bfa_svc.c
@@ -117,6 +117,8 @@ static void	hal_fcxp_tx_plog(struct bfa_s *bfa, u32 reqlen,
 static void	bfa_fcxp_qresume(void *cbarg);
 static void	bfa_fcxp_queue(struct bfa_fcxp_s *fcxp,
 				struct bfi_fcxp_send_req_s *send_req);
+static void bfa_fcxp_free(struct bfa_fcxp_s *fcxp);
+
 
 /*
  * forward declarations for LPS functions
@@ -143,6 +145,7 @@ static void bfa_lps_send_set_n2n_pid(struct bfa_lps_s *lps);
 static void bfa_lps_login_comp(struct bfa_lps_s *lps);
 static void bfa_lps_logout_comp(struct bfa_lps_s *lps);
 static void bfa_lps_cvl_event(struct bfa_lps_s *lps);
+static u8 bfa_lps_get_fwtag(struct bfa_s *bfa, u8 lp_tag);
 
 /*
  * forward declaration for LPS state machine
@@ -175,6 +178,10 @@ static void __bfa_cb_fcport_stats_clr(void *cbarg, bfa_boolean_t complete);
 static void bfa_fcport_stats_get_timeout(void *cbarg);
 static void bfa_fcport_stats_clr_timeout(void *cbarg);
 static void bfa_trunk_iocdisable(struct bfa_s *bfa);
+static bfa_boolean_t bfa_fcport_is_qos_enabled(struct bfa_s *bfa);
+static bfa_boolean_t bfa_fcport_is_ddport(struct bfa_s *bfa);
+static bfa_boolean_t bfa_fcport_is_trunk_enabled(struct bfa_s *bfa);
+static bfa_status_t bfa_fcport_is_pbcdisabled(struct bfa_s *bfa);
 
 /*
  * forward declaration for FC PORT state machine
@@ -256,6 +263,7 @@ static void		__bfa_cb_rport_online(void *cbarg,
 						bfa_boolean_t complete);
 static void		__bfa_cb_rport_offline(void *cbarg,
 						bfa_boolean_t complete);
+static void bfa_rport_set_lunmask(struct bfa_s *bfa, struct bfa_rport_s *rp);
 
 /*
  * forward declaration for RPORT state machine
@@ -373,7 +381,7 @@ bfa_plog_str(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
 	}
 }
 
-void
+static void
 bfa_plog_intarr(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
 		enum bfa_plog_eid event,
 		u16 misc, u32 *intarr, u32 num_ints)
@@ -400,7 +408,7 @@ bfa_plog_intarr(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
 	}
 }
 
-void
+static void
 bfa_plog_fchdr(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
 			enum bfa_plog_eid event,
 			u16 misc, struct fchs_s *fchdr)
@@ -420,7 +428,7 @@ bfa_plog_fchdr(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
 	}
 }
 
-void
+static void
 bfa_plog_fchdr_and_pl(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
 		      enum bfa_plog_eid event, u16 misc, struct fchs_s *fchdr,
 		      u32 pld_w0)
@@ -1021,7 +1029,7 @@ bfa_fcxp_get_rspbuf(struct bfa_fcxp_s *fcxp)
  *
  * @return		void
  */
-void
+static void
 bfa_fcxp_free(struct bfa_fcxp_s *fcxp)
 {
 	struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod;
@@ -1983,7 +1991,7 @@ bfa_lps_fdisclogo(struct bfa_lps_s *lps)
 	bfa_sm_send_event(lps, BFA_LPS_SM_LOGOUT);
 }
 
-u8
+static u8
 bfa_lps_get_fwtag(struct bfa_s *bfa, u8 lp_tag)
 {
 	struct bfa_lps_mod_s    *mod = BFA_LPS_MOD(bfa);
@@ -3803,7 +3811,7 @@ bfa_fcport_disable(struct bfa_s *bfa)
 }
 
 /* If PBC is disabled on port, return error */
-bfa_status_t
+static bfa_status_t
 bfa_fcport_is_pbcdisabled(struct bfa_s *bfa)
 {
 	struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
@@ -3865,7 +3873,7 @@ bfa_fcport_cfg_speed(struct bfa_s *bfa, enum bfa_port_speed speed)
 /*
  * Get current speed.
  */
-enum bfa_port_speed
+static enum bfa_port_speed
 bfa_fcport_get_speed(struct bfa_s *bfa)
 {
 	struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
@@ -3933,7 +3941,7 @@ bfa_fcport_get_topology(struct bfa_s *bfa)
 /**
  * Get config topology.
  */
-enum bfa_port_topology
+static enum bfa_port_topology
 bfa_fcport_get_cfg_topology(struct bfa_s *bfa)
 {
 	struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
@@ -4173,7 +4181,7 @@ bfa_fcport_is_dport(struct bfa_s *bfa)
 		BFA_PORT_ST_DPORT);
 }
 
-bfa_boolean_t
+static bfa_boolean_t
 bfa_fcport_is_ddport(struct bfa_s *bfa)
 {
 	struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
@@ -4268,7 +4276,7 @@ bfa_fcport_is_linkup(struct bfa_s *bfa)
 		 fcport->trunk.attr.state == BFA_TRUNK_ONLINE);
 }
 
-bfa_boolean_t
+static bfa_boolean_t
 bfa_fcport_is_qos_enabled(struct bfa_s *bfa)
 {
 	struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
@@ -4355,7 +4363,7 @@ bfa_fcport_get_bbcr_attr(struct bfa_s *bfa,
 	return BFA_STATUS_OK;
 }
 
-void
+static void
 bfa_fcport_dportenable(struct bfa_s *bfa)
 {
 	/*
@@ -4365,7 +4373,7 @@ bfa_fcport_dportenable(struct bfa_s *bfa)
 	bfa_port_set_dportenabled(&bfa->modules.port, BFA_TRUE);
 }
 
-void
+static void
 bfa_fcport_dportdisable(struct bfa_s *bfa)
 {
 	/*
@@ -4375,7 +4383,7 @@ bfa_fcport_dportdisable(struct bfa_s *bfa)
 	bfa_port_set_dportenabled(&bfa->modules.port, BFA_FALSE);
 }
 
-void
+static void
 bfa_fcport_ddportenable(struct bfa_s *bfa)
 {
 	/*
@@ -4384,7 +4392,7 @@ bfa_fcport_ddportenable(struct bfa_s *bfa)
 	bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_DDPORTENABLE);
 }
 
-void
+static void
 bfa_fcport_ddportdisable(struct bfa_s *bfa)
 {
 	/*
@@ -5208,7 +5216,7 @@ bfa_rport_speed(struct bfa_rport_s *rport, enum bfa_port_speed speed)
 }
 
 /* Set Rport LUN Mask */
-void
+static void
 bfa_rport_set_lunmask(struct bfa_s *bfa, struct bfa_rport_s *rp)
 {
 	struct bfa_lps_mod_s	*lps_mod = BFA_LPS_MOD(bfa);
diff --git a/drivers/scsi/bfa/bfa_svc.h b/drivers/scsi/bfa/bfa_svc.h
index ea2278bc78a8..69222cc946e4 100644
--- a/drivers/scsi/bfa/bfa_svc.h
+++ b/drivers/scsi/bfa/bfa_svc.h
@@ -533,11 +533,9 @@ bfa_status_t bfa_fcport_enable(struct bfa_s *bfa);
 bfa_status_t bfa_fcport_disable(struct bfa_s *bfa);
 bfa_status_t bfa_fcport_cfg_speed(struct bfa_s *bfa,
 				  enum bfa_port_speed speed);
-enum bfa_port_speed bfa_fcport_get_speed(struct bfa_s *bfa);
 bfa_status_t bfa_fcport_cfg_topology(struct bfa_s *bfa,
 				     enum bfa_port_topology topo);
 enum bfa_port_topology bfa_fcport_get_topology(struct bfa_s *bfa);
-enum bfa_port_topology bfa_fcport_get_cfg_topology(struct bfa_s *bfa);
 bfa_status_t bfa_fcport_cfg_hardalpa(struct bfa_s *bfa, u8 alpa);
 bfa_boolean_t bfa_fcport_get_hardalpa(struct bfa_s *bfa, u8 *alpa);
 u8 bfa_fcport_get_myalpa(struct bfa_s *bfa);
@@ -552,7 +550,6 @@ void bfa_fcport_event_register(struct bfa_s *bfa,
 			enum bfa_port_linkstate event), void *event_cbarg);
 bfa_boolean_t bfa_fcport_is_disabled(struct bfa_s *bfa);
 bfa_boolean_t bfa_fcport_is_dport(struct bfa_s *bfa);
-bfa_boolean_t bfa_fcport_is_ddport(struct bfa_s *bfa);
 bfa_status_t bfa_fcport_set_qos_bw(struct bfa_s *bfa,
 				   struct bfa_qos_bw_s *qos_bw);
 enum bfa_port_speed bfa_fcport_get_ratelim_speed(struct bfa_s *bfa);
@@ -566,11 +563,6 @@ bfa_status_t bfa_fcport_get_stats(struct bfa_s *bfa,
 			struct bfa_cb_pending_q_s *cb);
 bfa_status_t bfa_fcport_clear_stats(struct bfa_s *bfa,
 			struct bfa_cb_pending_q_s *cb);
-bfa_boolean_t bfa_fcport_is_qos_enabled(struct bfa_s *bfa);
-bfa_boolean_t bfa_fcport_is_trunk_enabled(struct bfa_s *bfa);
-void bfa_fcport_dportenable(struct bfa_s *bfa);
-void bfa_fcport_dportdisable(struct bfa_s *bfa);
-bfa_status_t bfa_fcport_is_pbcdisabled(struct bfa_s *bfa);
 void bfa_fcport_cfg_faa(struct bfa_s *bfa, u8 state);
 bfa_status_t bfa_fcport_cfg_bbcr(struct bfa_s *bfa,
 			bfa_boolean_t on_off, u8 bb_scn);
@@ -601,7 +593,6 @@ void bfa_cb_rport_qos_scn_prio(void *rport,
  */
 #define BFA_RPORT_TAG_INVALID	0xffff
 #define BFA_LP_TAG_INVALID	0xff
-void	bfa_rport_set_lunmask(struct bfa_s *bfa, struct bfa_rport_s *rp);
 void	bfa_rport_unset_lunmask(struct bfa_s *bfa, struct bfa_rport_s *rp);
 
 /*
@@ -630,8 +621,6 @@ void bfa_fcxp_discard(struct bfa_fcxp_s *fcxp);
 void *bfa_fcxp_get_reqbuf(struct bfa_fcxp_s *fcxp);
 void *bfa_fcxp_get_rspbuf(struct bfa_fcxp_s *fcxp);
 
-void bfa_fcxp_free(struct bfa_fcxp_s *fcxp);
-
 void bfa_fcxp_send(struct bfa_fcxp_s *fcxp, struct bfa_rport_s *rport,
 		   u16 vf_id, u8 lp_tag,
 		   bfa_boolean_t cts, enum fc_cos cos,
@@ -677,7 +666,6 @@ void bfa_lps_fdisc(struct bfa_lps_s *lps, void *uarg, u16 pdusz,
 		   wwn_t pwwn, wwn_t nwwn);
 void bfa_lps_fdisclogo(struct bfa_lps_s *lps);
 void bfa_lps_set_n2n_pid(struct bfa_lps_s *lps, u32 n2n_pid);
-u8 bfa_lps_get_fwtag(struct bfa_s *bfa, u8 lp_tag);
 u32 bfa_lps_get_base_pid(struct bfa_s *bfa);
 u8 bfa_lps_get_tag_from_pid(struct bfa_s *bfa, u32 pid);
 void bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status);
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index 9d253cb83ee7..9b010b999825 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -38,27 +38,27 @@
 
 BFA_TRC_FILE(LDRV, BFAD);
 DEFINE_MUTEX(bfad_mutex);
-LIST_HEAD(bfad_list);
+static LIST_HEAD(bfad_list);
 
-static int	bfad_inst;
+int	bfad_inst;
 static int      num_sgpgs_parm;
 int		supported_fc4s;
-char		*host_name, *os_name, *os_patch;
-int		num_rports, num_ios, num_tms;
-int		num_fcxps, num_ufbufs;
-int		reqq_size, rspq_size, num_sgpgs;
-int		rport_del_timeout = BFA_FCS_RPORT_DEF_DEL_TIMEOUT;
+static char	*host_name, *os_name, *os_patch;
+static int	num_rports, num_ios, num_tms;
+static int	num_fcxps, num_ufbufs;
+static int	reqq_size, rspq_size, num_sgpgs;
+static int	rport_del_timeout = BFA_FCS_RPORT_DEF_DEL_TIMEOUT;
 int		bfa_lun_queue_depth = BFAD_LUN_QUEUE_DEPTH;
-int		bfa_io_max_sge = BFAD_IO_MAX_SGE;
+static int	bfa_io_max_sge = BFAD_IO_MAX_SGE;
 int		bfa_log_level = 3; /* WARNING log level */
-int		ioc_auto_recover = BFA_TRUE;
+static int	ioc_auto_recover = BFA_TRUE;
 int		bfa_linkup_delay = -1;
-int		fdmi_enable = BFA_TRUE;
-int		pcie_max_read_reqsz;
+static int	fdmi_enable = BFA_TRUE;
+static int	pcie_max_read_reqsz;
 int		bfa_debugfs_enable = 1;
-int		msix_disable_cb = 0, msix_disable_ct = 0;
+static int	msix_disable_cb = 0, msix_disable_ct = 0;
 int		max_xfer_size = BFAD_MAX_SECTORS >> 1;
-int		max_rport_logins = BFA_FCS_MAX_RPORT_LOGINS;
+static int	max_rport_logins = BFA_FCS_MAX_RPORT_LOGINS;
 
 /* Firmware releated */
 u32	bfi_image_cb_size, bfi_image_ct_size, bfi_image_ct2_size;
@@ -164,6 +164,19 @@ bfad_sm_failed(struct bfad_s *bfad, enum bfad_sm_event event);
 static void
 bfad_sm_fcs_exit(struct bfad_s *bfad, enum bfad_sm_event event);
 
+static bfa_status_t
+bfad_cfg_pport(struct bfad_s *bfad, enum bfa_lport_role role);
+static bfa_status_t bfad_start_ops(struct bfad_s *bfad);
+
+static void bfad_fcs_stop(struct bfad_s *bfad);
+static void bfad_init_timer(struct bfad_s *bfad);
+static int  bfad_install_msix_handler(struct bfad_s *bfad);
+static void bfad_stop(struct bfad_s *bfad);
+static void bfad_uncfg_pport(struct bfad_s *bfad);
+static int  bfad_worker(void *ptr);
+static int  bfad_setup_intr(struct bfad_s *bfad);
+static void bfad_remove_intr(struct bfad_s *bfad);
+
 /*
  * Beginning state for the driver instance, awaiting the pci_probe event
  */
@@ -527,7 +540,7 @@ bfa_fcb_pbc_vport_create(struct bfad_s *bfad, struct bfi_pbc_vport_s pbc_vport)
 	list_add_tail(&vport->list_entry, &bfad->pbc_vport_list);
 }
 
-void
+static void
 bfad_hal_mem_release(struct bfad_s *bfad)
 {
 	struct bfa_meminfo_s *hal_meminfo = &bfad->meminfo;
@@ -555,7 +568,7 @@ bfad_hal_mem_release(struct bfad_s *bfad)
 	memset(hal_meminfo, 0, sizeof(struct bfa_meminfo_s));
 }
 
-void
+static void
 bfad_update_hal_cfg(struct bfa_iocfc_cfg_s *bfa_cfg)
 {
 	if (num_rports > 0)
@@ -589,7 +602,7 @@ bfad_update_hal_cfg(struct bfa_iocfc_cfg_s *bfa_cfg)
 	num_sgpgs = bfa_cfg->drvcfg.num_sgpgs;
 }
 
-bfa_status_t
+static bfa_status_t
 bfad_hal_mem_alloc(struct bfad_s *bfad)
 {
 	struct bfa_meminfo_s *hal_meminfo = &bfad->meminfo;
@@ -691,7 +704,7 @@ ext:
 	return rc;
 }
 
-void
+static void
 bfad_bfa_tmo(unsigned long data)
 {
 	struct bfad_s	      *bfad = (struct bfad_s *) data;
@@ -716,7 +729,7 @@ bfad_bfa_tmo(unsigned long data)
 		  jiffies + msecs_to_jiffies(BFA_TIMER_FREQ));
 }
 
-void
+static void
 bfad_init_timer(struct bfad_s *bfad)
 {
 	init_timer(&bfad->hal_tmo);
@@ -727,7 +740,7 @@ bfad_init_timer(struct bfad_s *bfad)
 		  jiffies + msecs_to_jiffies(BFA_TIMER_FREQ));
 }
 
-int
+static int
 bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad)
 {
 	int		rc = -ENODEV;
@@ -808,7 +821,7 @@ out:
 	return rc;
 }
 
-void
+static void
 bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad)
 {
 	pci_iounmap(pdev, bfad->pci_bar0_kva);
@@ -819,7 +832,7 @@ bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad)
 	pci_disable_device(pdev);
 }
 
-bfa_status_t
+static bfa_status_t
 bfad_drv_init(struct bfad_s *bfad)
 {
 	bfa_status_t	rc;
@@ -880,7 +893,7 @@ bfad_drv_uninit(struct bfad_s *bfad)
 	bfad->bfad_flags &= ~BFAD_DRV_INIT_DONE;
 }
 
-void
+static void
 bfad_drv_start(struct bfad_s *bfad)
 {
 	unsigned long	flags;
@@ -896,7 +909,7 @@ bfad_drv_start(struct bfad_s *bfad)
 		flush_workqueue(bfad->im->drv_workq);
 }
 
-void
+static void
 bfad_fcs_stop(struct bfad_s *bfad)
 {
 	unsigned long	flags;
@@ -911,7 +924,7 @@ bfad_fcs_stop(struct bfad_s *bfad)
 	bfa_sm_send_event(bfad, BFAD_E_FCS_EXIT_COMP);
 }
 
-void
+static void
 bfad_stop(struct bfad_s *bfad)
 {
 	unsigned long	flags;
@@ -926,7 +939,7 @@ bfad_stop(struct bfad_s *bfad)
 	bfa_sm_send_event(bfad, BFAD_E_EXIT_COMP);
 }
 
-bfa_status_t
+static bfa_status_t
 bfad_cfg_pport(struct bfad_s *bfad, enum bfa_lport_role role)
 {
 	int		rc = BFA_STATUS_OK;
@@ -953,7 +966,7 @@ out:
 	return rc;
 }
 
-void
+static void
 bfad_uncfg_pport(struct bfad_s *bfad)
 {
 	if ((supported_fc4s & BFA_LPORT_ROLE_FCP_IM) &&
@@ -967,8 +980,9 @@ bfad_uncfg_pport(struct bfad_s *bfad)
 	bfad->bfad_flags &= ~BFAD_CFG_PPORT_DONE;
 }
 
-bfa_status_t
-bfad_start_ops(struct bfad_s *bfad) {
+static bfa_status_t
+bfad_start_ops(struct bfad_s *bfad)
+{
 
 	int	retval;
 	unsigned long	flags;
@@ -1072,7 +1086,7 @@ bfad_start_ops(struct bfad_s *bfad) {
 	return BFA_STATUS_OK;
 }
 
-int
+static int
 bfad_worker(void *ptr)
 {
 	struct bfad_s *bfad = ptr;
@@ -1094,7 +1108,7 @@ bfad_worker(void *ptr)
 /*
  *  BFA driver interrupt functions
  */
-irqreturn_t
+static irqreturn_t
 bfad_intx(int irq, void *dev_id)
 {
 	struct bfad_s	*bfad = dev_id;
@@ -1172,7 +1186,7 @@ bfad_init_msix_entry(struct bfad_s *bfad, struct msix_entry *msix_entries,
 
 }
 
-int
+static int
 bfad_install_msix_handler(struct bfad_s *bfad)
 {
 	int i, error = 0;
@@ -1208,7 +1222,7 @@ bfad_install_msix_handler(struct bfad_s *bfad)
 /*
  * Setup MSIX based interrupt.
  */
-int
+static int
 bfad_setup_intr(struct bfad_s *bfad)
 {
 	int error;
@@ -1277,7 +1291,7 @@ line_based:
 	return 0;
 }
 
-void
+static void
 bfad_remove_intr(struct bfad_s *bfad)
 {
 	int	i;
@@ -1297,7 +1311,7 @@ bfad_remove_intr(struct bfad_s *bfad)
 /*
  * PCI probe entry.
  */
-int
+static int
 bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid)
 {
 	struct bfad_s	*bfad;
@@ -1398,7 +1412,7 @@ out:
 /*
  * PCI remove entry.
  */
-void
+static void
 bfad_pci_remove(struct pci_dev *pdev)
 {
 	struct bfad_s	      *bfad = pci_get_drvdata(pdev);
@@ -1498,7 +1512,7 @@ bfad_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
 	return ret;
 }
 
-int
+static int
 restart_bfa(struct bfad_s *bfad)
 {
 	unsigned long flags;
@@ -1629,7 +1643,7 @@ bfad_pci_resume(struct pci_dev *pdev)
 	spin_unlock_irqrestore(&bfad->bfad_lock, flags);
 }
 
-struct pci_device_id bfad_id_table[] = {
+static struct pci_device_id bfad_id_table[] = {
 	{
 		.vendor = BFA_PCI_VENDOR_ID_BROCADE,
 		.device = BFA_PCI_DEVICE_ID_FC_8G2P,
diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c
index 13db3b7bc873..3668b02168f9 100644
--- a/drivers/scsi/bfa/bfad_attr.c
+++ b/drivers/scsi/bfa/bfad_attr.c
@@ -443,7 +443,7 @@ bfad_im_vport_create(struct fc_vport *fc_vport, bool disable)
 	return status;
 }
 
-int
+static int
 bfad_im_issue_fc_host_lip(struct Scsi_Host *shost)
 {
 	struct bfad_im_port_s *im_port =
@@ -571,7 +571,7 @@ bfad_im_vport_disable(struct fc_vport *fc_vport, bool disable)
 	return 0;
 }
 
-void
+static void
 bfad_im_vport_set_symbolic_name(struct fc_vport *fc_vport)
 {
 	struct bfad_vport_s *vport = (struct bfad_vport_s *)fc_vport->dd_data;
diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c
index d1ad0208dfe7..44cf38b9c2a5 100644
--- a/drivers/scsi/bfa/bfad_bsg.c
+++ b/drivers/scsi/bfa/bfad_bsg.c
@@ -23,7 +23,7 @@
 
 BFA_TRC_FILE(LDRV, BSG);
 
-int
+static int
 bfad_iocmd_ioc_enable(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -46,7 +46,7 @@ bfad_iocmd_ioc_enable(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ioc_disable(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -144,7 +144,7 @@ bfad_iocmd_ioc_get_attr(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ioc_get_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_ioc_stats_s *iocmd = (struct bfa_bsg_ioc_stats_s *)cmd;
@@ -154,7 +154,7 @@ bfad_iocmd_ioc_get_stats(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ioc_get_fwstats(struct bfad_s *bfad, void *cmd,
 			unsigned int payload_len)
 {
@@ -184,7 +184,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ioc_reset_stats(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -202,7 +202,7 @@ bfad_iocmd_ioc_reset_stats(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ioc_set_name(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_ioc_name_s *iocmd = (struct bfa_bsg_ioc_name_s *) cmd;
@@ -216,7 +216,7 @@ bfad_iocmd_ioc_set_name(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_iocfc_get_attr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_iocfc_attr_s *iocmd = (struct bfa_bsg_iocfc_attr_s *)cmd;
@@ -227,7 +227,7 @@ bfad_iocmd_iocfc_get_attr(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ioc_fw_sig_inv(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -239,7 +239,7 @@ bfad_iocmd_ioc_fw_sig_inv(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_iocfc_set_intr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_iocfc_intr_s *iocmd = (struct bfa_bsg_iocfc_intr_s *)cmd;
@@ -252,7 +252,7 @@ bfad_iocmd_iocfc_set_intr(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_port_enable(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -273,7 +273,7 @@ bfad_iocmd_port_enable(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_port_disable(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -323,7 +323,7 @@ bfad_iocmd_port_get_attr(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_port_get_stats(struct bfad_s *bfad, void *cmd,
 			unsigned int payload_len)
 {
@@ -357,7 +357,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_port_reset_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -378,7 +378,7 @@ bfad_iocmd_port_reset_stats(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_set_port_cfg(struct bfad_s *bfad, void *iocmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_port_cfg_s *cmd = (struct bfa_bsg_port_cfg_s *)iocmd;
@@ -398,7 +398,7 @@ bfad_iocmd_set_port_cfg(struct bfad_s *bfad, void *iocmd, unsigned int v_cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_port_cfg_maxfrsize(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_port_cfg_maxfrsize_s *iocmd =
@@ -412,7 +412,7 @@ bfad_iocmd_port_cfg_maxfrsize(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_port_cfg_bbcr(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
 {
 	struct bfa_bsg_bbcr_enable_s *iocmd =
@@ -435,7 +435,7 @@ bfad_iocmd_port_cfg_bbcr(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_port_get_bbcr_attr(struct bfad_s *bfad, void *pcmd)
 {
 	struct bfa_bsg_bbcr_attr_s *iocmd = (struct bfa_bsg_bbcr_attr_s *) pcmd;
@@ -473,7 +473,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_lport_get_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_fcs_lport_s *fcs_port;
@@ -497,7 +497,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_lport_reset_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_fcs_lport_s *fcs_port;
@@ -531,7 +531,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_lport_get_iostats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_fcs_lport_s *fcs_port;
@@ -556,7 +556,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_lport_get_rports(struct bfad_s *bfad, void *cmd,
 			unsigned int payload_len)
 {
@@ -598,7 +598,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_rport_get_attr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_rport_attr_s *iocmd = (struct bfa_bsg_rport_attr_s *)cmd;
@@ -684,7 +684,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_rport_get_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_rport_stats_s *iocmd =
@@ -725,7 +725,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_rport_clr_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_rport_reset_stats_s *iocmd =
@@ -761,7 +761,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_rport_set_speed(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_rport_set_speed_s *iocmd =
@@ -797,7 +797,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_vport_get_attr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_fcs_vport_s *fcs_vport;
@@ -820,7 +820,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_vport_get_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_fcs_vport_s *fcs_vport;
@@ -848,7 +848,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_vport_clr_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_fcs_vport_s *fcs_vport;
@@ -915,7 +915,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_qos_set_bw(struct bfad_s *bfad, void *pcmd)
 {
 	struct bfa_bsg_qos_bw_s *iocmd = (struct bfa_bsg_qos_bw_s *)pcmd;
@@ -928,7 +928,7 @@ bfad_iocmd_qos_set_bw(struct bfad_s *bfad, void *pcmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ratelim(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)pcmd;
@@ -957,7 +957,7 @@ bfad_iocmd_ratelim(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ratelim_speed(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
 {
 	struct bfa_bsg_trl_speed_s *iocmd = (struct bfa_bsg_trl_speed_s *)pcmd;
@@ -986,7 +986,7 @@ bfad_iocmd_ratelim_speed(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_cfg_fcpim(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcpim_s *iocmd = (struct bfa_bsg_fcpim_s *)cmd;
@@ -999,7 +999,7 @@ bfad_iocmd_cfg_fcpim(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcpim_get_modstats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcpim_modstats_s *iocmd =
@@ -1021,7 +1021,7 @@ bfad_iocmd_fcpim_get_modstats(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcpim_clr_modstats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcpim_modstatsclr_s *iocmd =
@@ -1043,7 +1043,7 @@ bfad_iocmd_fcpim_clr_modstats(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcpim_get_del_itn_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcpim_del_itn_stats_s *iocmd =
@@ -1168,7 +1168,7 @@ bfad_iocmd_itnim_get_itnstats(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcport_enable(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -1181,7 +1181,7 @@ bfad_iocmd_fcport_enable(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcport_disable(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -1194,7 +1194,7 @@ bfad_iocmd_fcport_disable(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ioc_get_pcifn_cfg(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_pcifn_cfg_s *iocmd = (struct bfa_bsg_pcifn_cfg_s *)cmd;
@@ -1216,7 +1216,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_pcifn_create(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_pcifn_s *iocmd = (struct bfa_bsg_pcifn_s *)cmd;
@@ -1239,7 +1239,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_pcifn_delete(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_pcifn_s *iocmd = (struct bfa_bsg_pcifn_s *)cmd;
@@ -1261,7 +1261,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_pcifn_bw(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_pcifn_s *iocmd = (struct bfa_bsg_pcifn_s *)cmd;
@@ -1285,7 +1285,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_adapter_cfg_mode(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_adapter_cfg_mode_s *iocmd =
@@ -1308,7 +1308,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_port_cfg_mode(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_port_cfg_mode_s *iocmd =
@@ -1332,7 +1332,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ablk_optrom(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)pcmd;
@@ -1358,7 +1358,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_faa_query(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_faa_attr_s *iocmd = (struct bfa_bsg_faa_attr_s *)cmd;
@@ -1381,7 +1381,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_cee_attr(struct bfad_s *bfad, void *cmd, unsigned int payload_len)
 {
 	struct bfa_bsg_cee_attr_s *iocmd =
@@ -1417,7 +1417,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_cee_get_stats(struct bfad_s *bfad, void *cmd,
 			unsigned int payload_len)
 {
@@ -1454,7 +1454,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_cee_reset_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -1468,7 +1468,7 @@ bfad_iocmd_cee_reset_stats(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_sfp_media(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_sfp_media_s *iocmd = (struct bfa_bsg_sfp_media_s *)cmd;
@@ -1490,7 +1490,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_sfp_speed(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_sfp_speed_s *iocmd = (struct bfa_bsg_sfp_speed_s *)cmd;
@@ -1511,7 +1511,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_flash_get_attr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_flash_attr_s *iocmd =
@@ -1532,7 +1532,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_flash_erase_part(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_flash_s *iocmd = (struct bfa_bsg_flash_s *)cmd;
@@ -1552,7 +1552,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_flash_update_part(struct bfad_s *bfad, void *cmd,
 			unsigned int payload_len)
 {
@@ -1584,7 +1584,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_flash_read_part(struct bfad_s *bfad, void *cmd,
 			unsigned int payload_len)
 {
@@ -1616,7 +1616,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_temp(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_diag_get_temp_s *iocmd =
@@ -1638,7 +1638,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_memtest(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_diag_memtest_s *iocmd =
@@ -1661,7 +1661,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_loopback(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_diag_loopback_s *iocmd =
@@ -1684,7 +1684,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_fwping(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_diag_fwping_s *iocmd =
@@ -1708,7 +1708,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_queuetest(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_diag_qtest_s *iocmd = (struct bfa_bsg_diag_qtest_s *)cmd;
@@ -1729,7 +1729,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_sfp(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_sfp_show_s *iocmd =
@@ -1752,7 +1752,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_led(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_diag_led_s *iocmd = (struct bfa_bsg_diag_led_s *)cmd;
@@ -1765,7 +1765,7 @@ bfad_iocmd_diag_led(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_beacon_lport(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_diag_beacon_s *iocmd =
@@ -1780,7 +1780,7 @@ bfad_iocmd_diag_beacon_lport(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_lb_stat(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_diag_lb_stat_s *iocmd =
@@ -1795,7 +1795,7 @@ bfad_iocmd_diag_lb_stat(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_dport_enable(struct bfad_s *bfad, void *pcmd)
 {
 	struct bfa_bsg_dport_enable_s *iocmd =
@@ -1817,7 +1817,7 @@ bfad_iocmd_diag_dport_enable(struct bfad_s *bfad, void *pcmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_dport_disable(struct bfad_s *bfad, void *pcmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)pcmd;
@@ -1837,7 +1837,7 @@ bfad_iocmd_diag_dport_disable(struct bfad_s *bfad, void *pcmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_dport_start(struct bfad_s *bfad, void *pcmd)
 {
 	struct bfa_bsg_dport_enable_s *iocmd =
@@ -1862,7 +1862,7 @@ bfad_iocmd_diag_dport_start(struct bfad_s *bfad, void *pcmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_dport_show(struct bfad_s *bfad, void *pcmd)
 {
 	struct bfa_bsg_diag_dport_show_s *iocmd =
@@ -1877,7 +1877,7 @@ bfad_iocmd_diag_dport_show(struct bfad_s *bfad, void *pcmd)
 }
 
 
-int
+static int
 bfad_iocmd_phy_get_attr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_phy_attr_s *iocmd =
@@ -1898,7 +1898,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_phy_get_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_phy_stats_s *iocmd =
@@ -1919,7 +1919,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_phy_read(struct bfad_s *bfad, void *cmd, unsigned int payload_len)
 {
 	struct bfa_bsg_phy_s *iocmd = (struct bfa_bsg_phy_s *)cmd;
@@ -1951,7 +1951,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_vhba_query(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_vhba_attr_s *iocmd =
@@ -1970,7 +1970,7 @@ bfad_iocmd_vhba_query(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_phy_update(struct bfad_s *bfad, void *cmd, unsigned int payload_len)
 {
 	struct bfa_bsg_phy_s *iocmd = (struct bfa_bsg_phy_s *)cmd;
@@ -2000,7 +2000,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_porglog_get(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_debug_s *iocmd = (struct bfa_bsg_debug_s *)cmd;
@@ -2020,7 +2020,7 @@ out:
 }
 
 #define BFA_DEBUG_FW_CORE_CHUNK_SZ	0x4000U /* 16K chunks for FW dump */
-int
+static int
 bfad_iocmd_debug_fw_core(struct bfad_s *bfad, void *cmd,
 			unsigned int payload_len)
 {
@@ -2054,7 +2054,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_debug_ctl(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -2075,7 +2075,7 @@ bfad_iocmd_debug_ctl(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_porglog_ctl(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_portlogctl_s *iocmd = (struct bfa_bsg_portlogctl_s *)cmd;
@@ -2089,7 +2089,7 @@ bfad_iocmd_porglog_ctl(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcpim_cfg_profile(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_fcpim_profile_s *iocmd =
@@ -2135,7 +2135,7 @@ bfad_iocmd_itnim_get_ioprofile(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcport_get_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcport_stats_s *iocmd =
@@ -2160,7 +2160,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcport_reset_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -2184,7 +2184,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_boot_cfg(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_boot_s *iocmd = (struct bfa_bsg_boot_s *)cmd;
@@ -2206,7 +2206,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_boot_query(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_boot_s *iocmd = (struct bfa_bsg_boot_s *)cmd;
@@ -2228,7 +2228,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_preboot_query(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_preboot_s *iocmd = (struct bfa_bsg_preboot_s *)cmd;
@@ -2247,7 +2247,7 @@ bfad_iocmd_preboot_query(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ethboot_cfg(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_ethboot_s *iocmd = (struct bfa_bsg_ethboot_s *)cmd;
@@ -2270,7 +2270,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ethboot_query(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_ethboot_s *iocmd = (struct bfa_bsg_ethboot_s *)cmd;
@@ -2293,7 +2293,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_cfg_trunk(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -2333,7 +2333,7 @@ bfad_iocmd_cfg_trunk(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_trunk_get_attr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_trunk_attr_s *iocmd = (struct bfa_bsg_trunk_attr_s *)cmd;
@@ -2356,7 +2356,7 @@ bfad_iocmd_trunk_get_attr(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_qos(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -2384,7 +2384,7 @@ bfad_iocmd_qos(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_qos_get_attr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_qos_attr_s *iocmd = (struct bfa_bsg_qos_attr_s *)cmd;
@@ -2410,7 +2410,7 @@ bfad_iocmd_qos_get_attr(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_qos_get_vc_attr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_qos_vc_attr_s *iocmd =
@@ -2442,7 +2442,7 @@ bfad_iocmd_qos_get_vc_attr(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_qos_get_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcport_stats_s *iocmd =
@@ -2474,7 +2474,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_qos_reset_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -2505,7 +2505,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_vf_get_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_vf_stats_s *iocmd =
@@ -2528,7 +2528,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_vf_clr_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_vf_reset_stats_s *iocmd =
@@ -2565,7 +2565,7 @@ bfad_iocmd_lunmask_reset_lunscan_mode(struct bfad_s *bfad, int lunmask_cfg)
 		bfad_reset_sdev_bflags(vport->drv_port.im_port, lunmask_cfg);
 }
 
-int
+static int
 bfad_iocmd_lunmask(struct bfad_s *bfad, void *pcmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)pcmd;
@@ -2588,7 +2588,7 @@ bfad_iocmd_lunmask(struct bfad_s *bfad, void *pcmd, unsigned int v_cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcpim_lunmask_query(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcpim_lunmask_query_s *iocmd =
@@ -2602,7 +2602,7 @@ bfad_iocmd_fcpim_lunmask_query(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcpim_cfg_lunmask(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_fcpim_lunmask_s *iocmd =
@@ -2621,7 +2621,7 @@ bfad_iocmd_fcpim_cfg_lunmask(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcpim_throttle_query(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcpim_throttle_s *iocmd =
@@ -2636,7 +2636,7 @@ bfad_iocmd_fcpim_throttle_query(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcpim_throttle_set(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcpim_throttle_s *iocmd =
@@ -2651,7 +2651,7 @@ bfad_iocmd_fcpim_throttle_set(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_tfru_read(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_tfru_s *iocmd =
@@ -2673,7 +2673,7 @@ bfad_iocmd_tfru_read(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_tfru_write(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_tfru_s *iocmd =
@@ -2695,7 +2695,7 @@ bfad_iocmd_tfru_write(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fruvpd_read(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fruvpd_s *iocmd =
@@ -2717,7 +2717,7 @@ bfad_iocmd_fruvpd_read(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fruvpd_update(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fruvpd_s *iocmd =
@@ -2739,7 +2739,7 @@ bfad_iocmd_fruvpd_update(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fruvpd_get_max_size(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fruvpd_max_size_s *iocmd =
@@ -3191,7 +3191,7 @@ out:
 }
 
 /* FC passthru call backs */
-u64
+static u64
 bfad_fcxp_get_req_sgaddr_cb(void *bfad_fcxp, int sgeid)
 {
 	struct bfad_fcxp	*drv_fcxp = bfad_fcxp;
@@ -3203,7 +3203,7 @@ bfad_fcxp_get_req_sgaddr_cb(void *bfad_fcxp, int sgeid)
 	return addr;
 }
 
-u32
+static u32
 bfad_fcxp_get_req_sglen_cb(void *bfad_fcxp, int sgeid)
 {
 	struct bfad_fcxp	*drv_fcxp = bfad_fcxp;
@@ -3213,7 +3213,7 @@ bfad_fcxp_get_req_sglen_cb(void *bfad_fcxp, int sgeid)
 	return sge->sg_len;
 }
 
-u64
+static u64
 bfad_fcxp_get_rsp_sgaddr_cb(void *bfad_fcxp, int sgeid)
 {
 	struct bfad_fcxp	*drv_fcxp = bfad_fcxp;
@@ -3225,7 +3225,7 @@ bfad_fcxp_get_rsp_sgaddr_cb(void *bfad_fcxp, int sgeid)
 	return addr;
 }
 
-u32
+static u32
 bfad_fcxp_get_rsp_sglen_cb(void *bfad_fcxp, int sgeid)
 {
 	struct bfad_fcxp	*drv_fcxp = bfad_fcxp;
@@ -3235,7 +3235,7 @@ bfad_fcxp_get_rsp_sglen_cb(void *bfad_fcxp, int sgeid)
 	return sge->sg_len;
 }
 
-void
+static void
 bfad_send_fcpt_cb(void *bfad_fcxp, struct bfa_fcxp_s *fcxp, void *cbarg,
 		bfa_status_t req_status, u32 rsp_len, u32 resid_len,
 		struct fchs_s *rsp_fchs)
@@ -3250,7 +3250,7 @@ bfad_send_fcpt_cb(void *bfad_fcxp, struct bfa_fcxp_s *fcxp, void *cbarg,
 	complete(&drv_fcxp->comp);
 }
 
-struct bfad_buf_info *
+static struct bfad_buf_info *
 bfad_fcxp_map_sg(struct bfad_s *bfad, void *payload_kbuf,
 		 uint32_t payload_len, uint32_t *num_sgles)
 {
@@ -3293,7 +3293,7 @@ out_free_mem:
 	return NULL;
 }
 
-void
+static void
 bfad_fcxp_free_mem(struct bfad_s *bfad, struct bfad_buf_info *buf_base,
 		   uint32_t num_sgles)
 {
@@ -3311,7 +3311,7 @@ bfad_fcxp_free_mem(struct bfad_s *bfad, struct bfad_buf_info *buf_base,
 	}
 }
 
-int
+static int
 bfad_fcxp_bsg_send(struct fc_bsg_job *job, struct bfad_fcxp *drv_fcxp,
 		   bfa_bsg_fcpt_t *bsg_fcpt)
 {
@@ -3351,7 +3351,7 @@ bfad_fcxp_bsg_send(struct fc_bsg_job *job, struct bfad_fcxp *drv_fcxp,
 	return BFA_STATUS_OK;
 }
 
-int
+static int
 bfad_im_bsg_els_ct_request(struct fc_bsg_job *job)
 {
 	struct bfa_bsg_data *bsg_data;
diff --git a/drivers/scsi/bfa/bfad_drv.h b/drivers/scsi/bfa/bfad_drv.h
index f9e862093a25..b70870411af6 100644
--- a/drivers/scsi/bfa/bfad_drv.h
+++ b/drivers/scsi/bfa/bfad_drv.h
@@ -299,61 +299,19 @@ bfa_status_t	bfad_vport_create(struct bfad_s *bfad, u16 vf_id,
 				  struct device *dev);
 bfa_status_t	bfad_vf_create(struct bfad_s *bfad, u16 vf_id,
 			       struct bfa_lport_cfg_s *port_cfg);
-bfa_status_t	bfad_cfg_pport(struct bfad_s *bfad, enum bfa_lport_role role);
-bfa_status_t	bfad_drv_init(struct bfad_s *bfad);
-bfa_status_t	bfad_start_ops(struct bfad_s *bfad);
-void		bfad_drv_start(struct bfad_s *bfad);
-void		bfad_uncfg_pport(struct bfad_s *bfad);
-void		bfad_stop(struct bfad_s *bfad);
-void		bfad_fcs_stop(struct bfad_s *bfad);
-void		bfad_remove_intr(struct bfad_s *bfad);
-void		bfad_hal_mem_release(struct bfad_s *bfad);
 void		bfad_hcb_comp(void *arg, bfa_status_t status);
 
-int		bfad_setup_intr(struct bfad_s *bfad);
-void		bfad_remove_intr(struct bfad_s *bfad);
-void		bfad_update_hal_cfg(struct bfa_iocfc_cfg_s *bfa_cfg);
-bfa_status_t	bfad_hal_mem_alloc(struct bfad_s *bfad);
-void		bfad_bfa_tmo(unsigned long data);
-void		bfad_init_timer(struct bfad_s *bfad);
-int		bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad);
-void		bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad);
 void		bfad_drv_uninit(struct bfad_s *bfad);
-int		bfad_worker(void *ptr);
 void		bfad_debugfs_init(struct bfad_port_s *port);
 void		bfad_debugfs_exit(struct bfad_port_s *port);
 
-void bfad_pci_remove(struct pci_dev *pdev);
-int bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid);
 void bfad_rport_online_wait(struct bfad_s *bfad);
 int bfad_get_linkup_delay(struct bfad_s *bfad);
-int bfad_install_msix_handler(struct bfad_s *bfad);
-
-extern struct idr bfad_im_port_index;
-extern struct pci_device_id bfad_id_table[];
-extern struct list_head bfad_list;
-extern char	*os_name;
-extern char	*os_patch;
-extern char	*host_name;
-extern int	num_rports;
-extern int	num_ios;
-extern int	num_tms;
-extern int	num_fcxps;
-extern int	num_ufbufs;
-extern int	reqq_size;
-extern int	rspq_size;
-extern int	num_sgpgs;
-extern int      rport_del_timeout;
+
 extern int      bfa_lun_queue_depth;
-extern int      bfa_io_max_sge;
 extern int      bfa_log_level;
-extern int      ioc_auto_recover;
 extern int      bfa_linkup_delay;
-extern int      msix_disable_cb;
-extern int      msix_disable_ct;
-extern int      fdmi_enable;
 extern int      supported_fc4s;
-extern int	pcie_max_read_reqsz;
 extern int	max_xfer_size;
 extern int bfa_debugfs_enable;
 extern struct mutex bfad_mutex;
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c
index 02d806012fa1..f56a22a640ea 100644
--- a/drivers/scsi/bfa/bfad_im.c
+++ b/drivers/scsi/bfa/bfad_im.c
@@ -28,7 +28,8 @@
 
 BFA_TRC_FILE(LDRV, IM);
 
-DEFINE_IDR(bfad_im_port_index);
+static DEFINE_IDR(bfad_im_port_index);
+static struct scsi_host_template bfad_im_vport_template;
 struct scsi_transport_template *bfad_im_scsi_transport_template;
 struct scsi_transport_template *bfad_im_scsi_vport_transport_template;
 static void bfad_im_itnim_work_handler(struct work_struct *work);
@@ -36,6 +37,14 @@ static int bfad_im_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmnd);
 static int bfad_im_slave_alloc(struct scsi_device *sdev);
 static void bfad_im_fc_rport_add(struct bfad_im_port_s  *im_port,
 				struct bfad_itnim_s *itnim);
+static void bfad_destroy_workq(struct bfad_im_s *im);
+static void bfad_handle_qfull(struct bfad_itnim_s *itnim,
+			      struct scsi_device *sdev);
+static struct Scsi_Host * bfad_scsi_host_alloc(struct bfad_im_port_s *im_port,
+					       struct bfad_s *bfad);
+static bfa_status_t bfad_thread_workq(struct bfad_s *bfad);
+static void bfad_ramp_up_qdepth(struct bfad_itnim_s *itnim,
+				struct scsi_device *sdev);
 
 void
 bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio,
@@ -740,7 +749,7 @@ bfad_im_probe_undo(struct bfad_s *bfad)
 	}
 }
 
-struct Scsi_Host *
+static struct Scsi_Host *
 bfad_scsi_host_alloc(struct bfad_im_port_s *im_port, struct bfad_s *bfad)
 {
 	struct scsi_host_template *sht;
@@ -768,7 +777,7 @@ bfad_scsi_host_free(struct bfad_s *bfad, struct bfad_im_port_s *im_port)
 	kfree(im_port);
 }
 
-void
+static void
 bfad_destroy_workq(struct bfad_im_s *im)
 {
 	if (im && im->drv_workq) {
@@ -778,7 +787,7 @@ bfad_destroy_workq(struct bfad_im_s *im)
 	}
 }
 
-bfa_status_t
+static bfa_status_t
 bfad_thread_workq(struct bfad_s *bfad)
 {
 	struct bfad_im_s      *im = bfad->im;
@@ -830,7 +839,7 @@ struct scsi_host_template bfad_im_scsi_host_template = {
 	.vendor_id = BFA_PCI_VENDOR_ID_BROCADE,
 };
 
-struct scsi_host_template bfad_im_vport_template = {
+static struct scsi_host_template bfad_im_vport_template = {
 	.module = THIS_MODULE,
 	.name = BFAD_DRIVER_NAME,
 	.info = bfad_im_info,
@@ -881,7 +890,7 @@ bfad_im_module_exit(void)
 	idr_destroy(&bfad_im_port_index);
 }
 
-void
+static void
 bfad_ramp_up_qdepth(struct bfad_itnim_s *itnim, struct scsi_device *sdev)
 {
 	struct scsi_device *tmp_sdev;
@@ -903,7 +912,7 @@ bfad_ramp_up_qdepth(struct bfad_itnim_s *itnim, struct scsi_device *sdev)
 	}
 }
 
-void
+static void
 bfad_handle_qfull(struct bfad_itnim_s *itnim, struct scsi_device *sdev)
 {
 	struct scsi_device *tmp_sdev;
diff --git a/drivers/scsi/bfa/bfad_im.h b/drivers/scsi/bfa/bfad_im.h
index 836fdc221edd..10761786287a 100644
--- a/drivers/scsi/bfa/bfad_im.h
+++ b/drivers/scsi/bfa/bfad_im.h
@@ -142,20 +142,12 @@ struct bfad_im_s {
 			   &(_drv)->im->aen_im_notify_work);		      \
 } while (0)
 
-struct Scsi_Host *bfad_scsi_host_alloc(struct bfad_im_port_s *im_port,
-				struct bfad_s *);
-bfa_status_t bfad_thread_workq(struct bfad_s *bfad);
-void bfad_destroy_workq(struct bfad_im_s *im);
 void bfad_fc_host_init(struct bfad_im_port_s *im_port);
 void bfad_scsi_host_free(struct bfad_s *bfad,
 				 struct bfad_im_port_s *im_port);
-void bfad_ramp_up_qdepth(struct bfad_itnim_s *itnim,
-				 struct scsi_device *sdev);
-void bfad_handle_qfull(struct bfad_itnim_s *itnim, struct scsi_device *sdev);
 struct bfad_itnim_s *bfad_get_itnim(struct bfad_im_port_s *im_port, int id);
 
 extern struct scsi_host_template bfad_im_scsi_host_template;
-extern struct scsi_host_template bfad_im_vport_template;
 extern struct fc_function_template bfad_im_fc_function_template;
 extern struct fc_function_template bfad_im_vport_fc_function_template;
 extern struct scsi_transport_template *bfad_im_scsi_transport_template;
@@ -164,8 +156,6 @@ extern struct scsi_transport_template *bfad_im_scsi_vport_transport_template;
 extern struct device_attribute *bfad_im_host_attrs[];
 extern struct device_attribute *bfad_im_vport_attrs[];
 
-irqreturn_t bfad_intx(int irq, void *dev_id);
-
 int bfad_im_bsg_request(struct fc_bsg_job *job);
 int bfad_im_bsg_timeout(struct fc_bsg_job *job);
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/5] bfa: remove unused variables
  2016-08-02 15:22 [PATCH 0/5] bfa: fix W=1 build warnings Arnd Bergmann
  2016-08-02 15:22 ` [PATCH 1/5] bfa: mark symbols static where possible Arnd Bergmann
@ 2016-08-02 15:22 ` Arnd Bergmann
  2016-08-02 15:22 ` [PATCH 3/5] bfa: rename some global variables Arnd Bergmann
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2016-08-02 15:22 UTC (permalink / raw)
  To: Anil Gurumurthy, Sudarsana Kalluru
  Cc: James E . J . Bottomley, Martin K . Petersen, linux-scsi,
	linux-kernel, Baoyou Xie, Arnd Bergmann

Building with W=1 shows some warnings about local variables that
are initialized but never used:

bfa/bfad_attr.c: In function 'bfad_im_vport_delete':
bfa/bfad_attr.c:490:22: error: variable 'port' set but not used
bfa/bfa_fcs_rport.c: In function 'bfa_fcs_rport_process_adisc':
bfa/bfa_fcs_rport.c:2259:21: error: variable 'adisc' set but not used
bfa/bfa_fcpim.c: In function 'bfa_fcpim_lunmask_delete':
bfa/bfa_fcpim.c:2366:22: error: variable 'rp' set but not used
bfa/bfa_ioc.c: In function 'bfa_iocpf_sm_fwcheck_entry':
bfa/bfa_ioc.c:720:27: error: variable 'pgoff' set but not used
bfa/bfa_ioc.c: In function 'bfa_ioc_fwver_get':
bfa/bfa_ioc.c:1463:13: error: variable 'pgoff' set but not used
bfa/bfa_ioc.c: In function 'bfa_ioc_fwsig_invalidate':
bfa/bfa_ioc.c:1685:13: error: variable 'pgoff' set but not used
bfa/bfa_ioc.c: In function 'bfa_ioc_download_fw':
bfa/bfa_ioc.c:1884:13: error: variable 'pgoff' set but not used
bfa/bfa_ioc.c: In function 'bfa_diag_memtest_done':
bfa/bfa_ioc.c:4763:13: error: variable 'pgoff' set but not used
bfa/bfa_ioc.c: In function 'bfa_flash_fifo_flush':
bfa/bfa_ioc.c:6803:6: error: variable 't' set but not used
bfa/bfa_svc.c: In function 'uf_recv':
bfa/bfa_svc.c:5605:17: error: variable 'fchs' set but not used

This removes all those variables.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/bfa/bfa_fcpim.c     |  6 +-----
 drivers/scsi/bfa/bfa_fcs_rport.c |  3 ---
 drivers/scsi/bfa/bfa_ioc.c       | 18 ++++++------------
 drivers/scsi/bfa/bfa_svc.c       |  3 ---
 drivers/scsi/bfa/bfad_attr.c     |  3 ---
 5 files changed, 7 insertions(+), 26 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c
index 2132ab2ca88e..6dc3e8afa652 100644
--- a/drivers/scsi/bfa/bfa_fcpim.c
+++ b/drivers/scsi/bfa/bfa_fcpim.c
@@ -2363,9 +2363,7 @@ bfa_fcpim_lunmask_delete(struct bfa_s *bfa, u16 vf_id, wwn_t *pwwn,
 			 wwn_t rpwwn, struct scsi_lun lun)
 {
 	struct bfa_lun_mask_s	*lunm_list;
-	struct bfa_rport_s	*rp = NULL;
 	struct bfa_fcs_lport_s *port = NULL;
-	struct bfa_fcs_rport_s *rp_fcs;
 	int	i;
 
 	/* in min cfg lunm_list could be NULL but  no commands should run. */
@@ -2383,9 +2381,7 @@ bfa_fcpim_lunmask_delete(struct bfa_s *bfa, u16 vf_id, wwn_t *pwwn,
 				vf_id, *pwwn);
 		if (port) {
 			*pwwn = port->port_cfg.pwwn;
-			rp_fcs = bfa_fcs_lport_get_rport_by_pwwn(port, rpwwn);
-			if (rp_fcs)
-				rp = rp_fcs->bfa_rport;
+			(void)bfa_fcs_lport_get_rport_by_pwwn(port, rpwwn);
 		}
 	}
 
diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c
index 1d722e272f18..24e6a126edb0 100644
--- a/drivers/scsi/bfa/bfa_fcs_rport.c
+++ b/drivers/scsi/bfa/bfa_fcs_rport.c
@@ -2256,15 +2256,12 @@ bfa_fcs_rport_process_adisc(struct bfa_fcs_rport_s *rport,
 	struct bfa_fcxp_s *fcxp;
 	struct fchs_s	fchs;
 	struct bfa_fcs_lport_s *port = rport->port;
-	struct fc_adisc_s	*adisc;
 
 	bfa_trc(port->fcs, rx_fchs->s_id);
 	bfa_trc(port->fcs, rx_fchs->d_id);
 
 	rport->stats.adisc_rcvd++;
 
-	adisc = (struct fc_adisc_s *) (rx_fchs + 1);
-
 	/*
 	 * Accept if the itnim for this rport is online.
 	 * Else reject the ADISC.
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index d2974797e52d..a503a1a0f44d 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -717,7 +717,7 @@ static void
 bfa_iocpf_sm_fwcheck_entry(struct bfa_iocpf_s *iocpf)
 {
 	struct bfi_ioc_image_hdr_s	fwhdr;
-	u32	r32, fwstate, pgnum, pgoff, loff = 0;
+	u32	r32, fwstate, pgnum, loff = 0;
 	int	i;
 
 	/*
@@ -747,7 +747,6 @@ bfa_iocpf_sm_fwcheck_entry(struct bfa_iocpf_s *iocpf)
 	 * Clear fwver hdr
 	 */
 	pgnum = PSS_SMEM_PGNUM(iocpf->ioc->ioc_regs.smem_pg0, loff);
-	pgoff = PSS_SMEM_PGOFF(loff);
 	writel(pgnum, iocpf->ioc->ioc_regs.host_page_num_fn);
 
 	for (i = 0; i < sizeof(struct bfi_ioc_image_hdr_s) / sizeof(u32); i++) {
@@ -1460,13 +1459,12 @@ bfa_ioc_lpu_stop(struct bfa_ioc_s *ioc)
 void
 bfa_ioc_fwver_get(struct bfa_ioc_s *ioc, struct bfi_ioc_image_hdr_s *fwhdr)
 {
-	u32	pgnum, pgoff;
+	u32	pgnum;
 	u32	loff = 0;
 	int		i;
 	u32	*fwsig = (u32 *) fwhdr;
 
 	pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff);
-	pgoff = PSS_SMEM_PGOFF(loff);
 	writel(pgnum, ioc->ioc_regs.host_page_num_fn);
 
 	for (i = 0; i < (sizeof(struct bfi_ioc_image_hdr_s) / sizeof(u32));
@@ -1682,7 +1680,7 @@ bfa_status_t
 bfa_ioc_fwsig_invalidate(struct bfa_ioc_s *ioc)
 {
 
-	u32	pgnum, pgoff;
+	u32	pgnum;
 	u32	loff = 0;
 	enum bfi_ioc_state ioc_fwstate;
 
@@ -1691,7 +1689,6 @@ bfa_ioc_fwsig_invalidate(struct bfa_ioc_s *ioc)
 		return BFA_STATUS_ADAPTER_ENABLED;
 
 	pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff);
-	pgoff = PSS_SMEM_PGOFF(loff);
 	writel(pgnum, ioc->ioc_regs.host_page_num_fn);
 	bfa_mem_write(ioc->ioc_regs.smem_page_start, loff, BFA_IOC_FW_INV_SIGN);
 
@@ -1881,7 +1878,7 @@ bfa_ioc_download_fw(struct bfa_ioc_s *ioc, u32 boot_type,
 		    u32 boot_env)
 {
 	u32 *fwimg;
-	u32 pgnum, pgoff;
+	u32 pgnum;
 	u32 loff = 0;
 	u32 chunkno = 0;
 	u32 i;
@@ -1910,7 +1907,6 @@ bfa_ioc_download_fw(struct bfa_ioc_s *ioc, u32 boot_type,
 
 
 	pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff);
-	pgoff = PSS_SMEM_PGOFF(loff);
 
 	writel(pgnum, ioc->ioc_regs.host_page_num_fn);
 
@@ -4781,10 +4777,9 @@ bfa_diag_memtest_done(void *cbarg)
 	struct bfa_ioc_s  *ioc = diag->ioc;
 	struct bfa_diag_memtest_result *res = diag->result;
 	u32	loff = BFI_BOOT_MEMTEST_RES_ADDR;
-	u32	pgnum, pgoff, i;
+	u32	pgnum, i;
 
 	pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff);
-	pgoff = PSS_SMEM_PGOFF(loff);
 
 	writel(pgnum, ioc->ioc_regs.host_page_num_fn);
 
@@ -6821,7 +6816,6 @@ static u32
 bfa_flash_fifo_flush(void __iomem *pci_bar)
 {
 	u32 i;
-	u32 t;
 	union bfa_flash_dev_status_reg_u dev_status;
 
 	dev_status.i = readl(pci_bar + FLI_DEV_STATUS_REG);
@@ -6831,7 +6825,7 @@ bfa_flash_fifo_flush(void __iomem *pci_bar)
 
 	/* fifo counter in terms of words */
 	for (i = 0; i < dev_status.r.fifo_cnt; i++)
-		t = readl(pci_bar + FLI_RDDATA_REG);
+		(void)readl(pci_bar + FLI_RDDATA_REG);
 
 	/*
 	 * Check the device status. It may take some time.
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index 5345ebb81646..9804768c8bba 100644
--- a/drivers/scsi/bfa/bfa_svc.c
+++ b/drivers/scsi/bfa/bfa_svc.c
@@ -5656,7 +5656,6 @@ uf_recv(struct bfa_s *bfa, struct bfi_uf_frm_rcvd_s *m)
 	struct bfa_uf_s *uf = &ufm->uf_list[uf_tag];
 	struct bfa_uf_buf_s *uf_buf;
 	uint8_t *buf;
-	struct fchs_s *fchs;
 
 	uf_buf = (struct bfa_uf_buf_s *)
 			bfa_mem_get_dmabuf_kva(ufm, uf_tag, uf->pb_len);
@@ -5665,8 +5664,6 @@ uf_recv(struct bfa_s *bfa, struct bfi_uf_frm_rcvd_s *m)
 	m->frm_len = be16_to_cpu(m->frm_len);
 	m->xfr_len = be16_to_cpu(m->xfr_len);
 
-	fchs = (struct fchs_s *)uf_buf;
-
 	list_del(&uf->qe);	/* dequeue from posted queue */
 
 	uf->data_ptr = buf;
diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c
index 3668b02168f9..d6a5edabf1ff 100644
--- a/drivers/scsi/bfa/bfad_attr.c
+++ b/drivers/scsi/bfa/bfad_attr.c
@@ -487,7 +487,6 @@ bfad_im_vport_delete(struct fc_vport *fc_vport)
 	struct bfad_im_port_s *im_port =
 			(struct bfad_im_port_s *) vport->drv_port.im_port;
 	struct bfad_s *bfad = im_port->bfad;
-	struct bfad_port_s *port;
 	struct bfa_fcs_vport_s *fcs_vport;
 	struct Scsi_Host *vshost;
 	wwn_t   pwwn;
@@ -502,8 +501,6 @@ bfad_im_vport_delete(struct fc_vport *fc_vport)
 		return 0;
 	}
 
-	port = im_port->port;
-
 	vshost = vport->drv_port.im_port->shost;
 	u64_to_wwn(fc_host_port_name(vshost), (u8 *)&pwwn);
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/5] bfa: rename some global variables
  2016-08-02 15:22 [PATCH 0/5] bfa: fix W=1 build warnings Arnd Bergmann
  2016-08-02 15:22 ` [PATCH 1/5] bfa: mark symbols static where possible Arnd Bergmann
  2016-08-02 15:22 ` [PATCH 2/5] bfa: remove unused variables Arnd Bergmann
@ 2016-08-02 15:22 ` Arnd Bergmann
  2016-08-02 15:22 ` [PATCH 4/5] bfa: remove unused functions from fbbuild.c Arnd Bergmann
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2016-08-02 15:22 UTC (permalink / raw)
  To: Anil Gurumurthy, Sudarsana Kalluru
  Cc: James E . J . Bottomley, Martin K . Petersen, linux-scsi,
	linux-kernel, Baoyou Xie, Arnd Bergmann

The global "supported_fc4s" and "max_xfer_size" variables have rather
generic names that might conflict with the same identifiers used in
other drivers, and we cannot make them 'static' because they are both
used across multiple files.

This adds a 'bfa_' prefix to ensure the identifiers are globally unique.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/bfa/bfad.c      | 20 ++++++++++----------
 drivers/scsi/bfa/bfad_attr.c |  2 +-
 drivers/scsi/bfa/bfad_drv.h  |  4 ++--
 drivers/scsi/bfa/bfad_im.c   |  6 +++---
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index 9b010b999825..3cb11f6c0b28 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -42,7 +42,7 @@ static LIST_HEAD(bfad_list);
 
 int	bfad_inst;
 static int      num_sgpgs_parm;
-int		supported_fc4s;
+int		bfa_supported_fc4s;
 static char	*host_name, *os_name, *os_patch;
 static int	num_rports, num_ios, num_tms;
 static int	num_fcxps, num_ufbufs;
@@ -57,7 +57,7 @@ static int	fdmi_enable = BFA_TRUE;
 static int	pcie_max_read_reqsz;
 int		bfa_debugfs_enable = 1;
 static int	msix_disable_cb = 0, msix_disable_ct = 0;
-int		max_xfer_size = BFAD_MAX_SECTORS >> 1;
+int		bfa_max_xfer_size = BFAD_MAX_SECTORS >> 1;
 static int	max_rport_logins = BFA_FCS_MAX_RPORT_LOGINS;
 
 /* Firmware releated */
@@ -143,7 +143,7 @@ MODULE_PARM_DESC(pcie_max_read_reqsz, "PCIe max read request size, default=0 "
 module_param(bfa_debugfs_enable, int, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(bfa_debugfs_enable, "Enables debugfs feature, default=1,"
 		" Range[false:0|true:1]");
-module_param(max_xfer_size, int, S_IRUGO | S_IWUSR);
+module_param_named(max_xfer_size, bfa_max_xfer_size, int, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(max_xfer_size, "default=32MB,"
 		" Range[64k|128k|256k|512k|1024k|2048k]");
 module_param(max_rport_logins, int, S_IRUGO | S_IWUSR);
@@ -945,7 +945,7 @@ bfad_cfg_pport(struct bfad_s *bfad, enum bfa_lport_role role)
 	int		rc = BFA_STATUS_OK;
 
 	/* Allocate scsi_host for the physical port */
-	if ((supported_fc4s & BFA_LPORT_ROLE_FCP_IM) &&
+	if ((bfa_supported_fc4s & BFA_LPORT_ROLE_FCP_IM) &&
 	    (role & BFA_LPORT_ROLE_FCP_IM)) {
 		if (bfad->pport.im_port == NULL) {
 			rc = BFA_STATUS_FAILED;
@@ -969,7 +969,7 @@ out:
 static void
 bfad_uncfg_pport(struct bfad_s *bfad)
 {
-	if ((supported_fc4s & BFA_LPORT_ROLE_FCP_IM) &&
+	if ((bfa_supported_fc4s & BFA_LPORT_ROLE_FCP_IM) &&
 	    (bfad->pport.roles & BFA_LPORT_ROLE_FCP_IM)) {
 		bfad_im_scsi_host_free(bfad, bfad->pport.im_port);
 		bfad_im_port_clean(bfad->pport.im_port);
@@ -990,10 +990,10 @@ bfad_start_ops(struct bfad_s *bfad)
 	struct bfa_fcs_driver_info_s driver_info;
 
 	/* Limit min/max. xfer size to [64k-32MB] */
-	if (max_xfer_size < BFAD_MIN_SECTORS >> 1)
-		max_xfer_size = BFAD_MIN_SECTORS >> 1;
-	if (max_xfer_size > BFAD_MAX_SECTORS >> 1)
-		max_xfer_size = BFAD_MAX_SECTORS >> 1;
+	if (bfa_max_xfer_size < BFAD_MIN_SECTORS >> 1)
+		bfa_max_xfer_size = BFAD_MIN_SECTORS >> 1;
+	if (bfa_max_xfer_size > BFAD_MAX_SECTORS >> 1)
+		bfa_max_xfer_size = BFAD_MAX_SECTORS >> 1;
 
 	/* Fill the driver_info info to fcs*/
 	memset(&driver_info, 0, sizeof(driver_info));
@@ -1734,7 +1734,7 @@ bfad_init(void)
 	}
 
 	if (strcmp(FCPI_NAME, " fcpim") == 0)
-		supported_fc4s |= BFA_LPORT_ROLE_FCP_IM;
+		bfa_supported_fc4s |= BFA_LPORT_ROLE_FCP_IM;
 
 	bfa_auto_recover = ioc_auto_recover;
 	bfa_fcs_rport_set_del_timeout(rport_del_timeout);
diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c
index d6a5edabf1ff..f49c6a7e6323 100644
--- a/drivers/scsi/bfa/bfad_attr.c
+++ b/drivers/scsi/bfa/bfad_attr.c
@@ -416,7 +416,7 @@ bfad_im_vport_create(struct fc_vport *fc_vport, bool disable)
 			sizeof(fc_host_supported_fc4s(vshost)));
 
 		/* For FCP type 0x08 */
-		if (supported_fc4s & BFA_LPORT_ROLE_FCP_IM)
+		if (bfa_supported_fc4s & BFA_LPORT_ROLE_FCP_IM)
 			fc_host_supported_fc4s(vshost)[2] = 1;
 
 		/* For fibre channel services type 0x20 */
diff --git a/drivers/scsi/bfa/bfad_drv.h b/drivers/scsi/bfa/bfad_drv.h
index b70870411af6..6c5b81708a08 100644
--- a/drivers/scsi/bfa/bfad_drv.h
+++ b/drivers/scsi/bfa/bfad_drv.h
@@ -311,8 +311,8 @@ int bfad_get_linkup_delay(struct bfad_s *bfad);
 extern int      bfa_lun_queue_depth;
 extern int      bfa_log_level;
 extern int      bfa_linkup_delay;
-extern int      supported_fc4s;
-extern int	max_xfer_size;
+extern int      bfa_supported_fc4s;
+extern int	bfa_max_xfer_size;
 extern int bfa_debugfs_enable;
 extern struct mutex bfad_mutex;
 
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c
index f56a22a640ea..50270e6188e9 100644
--- a/drivers/scsi/bfa/bfad_im.c
+++ b/drivers/scsi/bfa/bfad_im.c
@@ -759,8 +759,8 @@ bfad_scsi_host_alloc(struct bfad_im_port_s *im_port, struct bfad_s *bfad)
 	else
 		sht = &bfad_im_vport_template;
 
-	if (max_xfer_size != BFAD_MAX_SECTORS >> 1)
-		sht->max_sectors = max_xfer_size << 1;
+	if (bfa_max_xfer_size != BFAD_MAX_SECTORS >> 1)
+		sht->max_sectors = bfa_max_xfer_size << 1;
 
 	sht->sg_tablesize = bfad->cfg_data.io_max_sge;
 
@@ -1065,7 +1065,7 @@ bfad_fc_host_init(struct bfad_im_port_s *im_port)
 
 	memset(fc_host_supported_fc4s(host), 0,
 	       sizeof(fc_host_supported_fc4s(host)));
-	if (supported_fc4s & BFA_LPORT_ROLE_FCP_IM)
+	if (bfa_supported_fc4s & BFA_LPORT_ROLE_FCP_IM)
 		/* For FCP type 0x08 */
 		fc_host_supported_fc4s(host)[2] = 1;
 	/* For fibre channel services type 0x20 */
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/5] bfa: remove unused functions from fbbuild.c
  2016-08-02 15:22 [PATCH 0/5] bfa: fix W=1 build warnings Arnd Bergmann
                   ` (2 preceding siblings ...)
  2016-08-02 15:22 ` [PATCH 3/5] bfa: rename some global variables Arnd Bergmann
@ 2016-08-02 15:22 ` Arnd Bergmann
  2016-08-02 15:22 ` [PATCH 5/5] bfa: remove more unused functions Arnd Bergmann
  2016-08-10  5:28 ` [PATCH 0/5] bfa: fix W=1 build warnings Sudarsana Kalluru
  5 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2016-08-02 15:22 UTC (permalink / raw)
  To: Anil Gurumurthy, Sudarsana Kalluru
  Cc: James E . J . Bottomley, Martin K . Petersen, linux-scsi,
	linux-kernel, Baoyou Xie, Arnd Bergmann

A significant chunk of the functions in the bfa_fcbuild.c
file are never called, this removes them. I've split this
out from the patch to remove other unused functions, as
we are removing half the file here, and this seems to
be intended as a generic library.

We could mark them as 'static __maybe_unused' to keep the
source code around but shrink the object code by leaving
them out.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/bfa/bfa_fcbuild.c | 607 -----------------------------------------
 drivers/scsi/bfa/bfa_fcbuild.h |  87 ------
 2 files changed, 694 deletions(-)

diff --git a/drivers/scsi/bfa/bfa_fcbuild.c b/drivers/scsi/bfa/bfa_fcbuild.c
index baf22632ee96..81af5286944a 100644
--- a/drivers/scsi/bfa/bfa_fcbuild.c
+++ b/drivers/scsi/bfa/bfa_fcbuild.c
@@ -190,27 +190,6 @@ fc_els_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id)
 	fchs->ox_id = ox_id;
 }
 
-enum fc_parse_status
-fc_els_rsp_parse(struct fchs_s *fchs, int len)
-{
-	struct fc_els_cmd_s *els_cmd = (struct fc_els_cmd_s *) (fchs + 1);
-	struct fc_ls_rjt_s *ls_rjt = (struct fc_ls_rjt_s *) els_cmd;
-
-	len = len;
-
-	switch (els_cmd->els_code) {
-	case FC_ELS_LS_RJT:
-		if (ls_rjt->reason_code == FC_LS_RJT_RSN_LOGICAL_BUSY)
-			return FC_PARSE_BUSY;
-		else
-			return FC_PARSE_FAILURE;
-
-	case FC_ELS_ACC:
-		return FC_PARSE_OK;
-	}
-	return FC_PARSE_OK;
-}
-
 static void
 fc_bls_rsp_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id)
 {
@@ -249,44 +228,6 @@ fc_plogi_x_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id,
 }
 
 u16
-fc_flogi_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id,
-		u16 ox_id, wwn_t port_name, wwn_t node_name, u16 pdu_size,
-	       u8 set_npiv, u8 set_auth, u16 local_bb_credits)
-{
-	u32        d_id = bfa_hton3b(FC_FABRIC_PORT);
-	__be32	*vvl_info;
-
-	memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s));
-
-	flogi->els_cmd.els_code = FC_ELS_FLOGI;
-	fc_els_req_build(fchs, d_id, s_id, ox_id);
-
-	flogi->csp.rxsz = flogi->class3.rxsz = cpu_to_be16(pdu_size);
-	flogi->port_name = port_name;
-	flogi->node_name = node_name;
-
-	/*
-	 * Set the NPIV Capability Bit ( word 1, bit 31) of Common
-	 * Service Parameters.
-	 */
-	flogi->csp.ciro = set_npiv;
-
-	/* set AUTH capability */
-	flogi->csp.security = set_auth;
-
-	flogi->csp.bbcred = cpu_to_be16(local_bb_credits);
-
-	/* Set brcd token in VVL */
-	vvl_info = (u32 *)&flogi->vvl[0];
-
-	/* set the flag to indicate the presence of VVL */
-	flogi->csp.npiv_supp    = 1; /* @todo. field name is not correct */
-	vvl_info[0]	= cpu_to_be32(FLOGI_VVL_BRCD);
-
-	return sizeof(struct fc_logi_s);
-}
-
-u16
 fc_flogi_acc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id,
 		   __be16 ox_id, wwn_t port_name, wwn_t node_name,
 		   u16 pdu_size, u16 local_bb_credits, u8 bb_scn)
@@ -309,24 +250,6 @@ fc_flogi_acc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id,
 }
 
 u16
-fc_fdisc_build(struct fchs_s *fchs, struct fc_logi_s *flogi, u32 s_id,
-		u16 ox_id, wwn_t port_name, wwn_t node_name, u16 pdu_size)
-{
-	u32        d_id = bfa_hton3b(FC_FABRIC_PORT);
-
-	memcpy(flogi, &plogi_tmpl, sizeof(struct fc_logi_s));
-
-	flogi->els_cmd.els_code = FC_ELS_FDISC;
-	fc_els_req_build(fchs, d_id, s_id, ox_id);
-
-	flogi->csp.rxsz = flogi->class3.rxsz = cpu_to_be16(pdu_size);
-	flogi->port_name = port_name;
-	flogi->node_name = node_name;
-
-	return sizeof(struct fc_logi_s);
-}
-
-u16
 fc_plogi_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id,
 	       u16 ox_id, wwn_t port_name, wwn_t node_name,
 	       u16 pdu_size, u16 bb_cr)
@@ -345,40 +268,6 @@ fc_plogi_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id,
 }
 
 enum fc_parse_status
-fc_plogi_rsp_parse(struct fchs_s *fchs, int len, wwn_t port_name)
-{
-	struct fc_els_cmd_s *els_cmd = (struct fc_els_cmd_s *) (fchs + 1);
-	struct fc_logi_s *plogi;
-	struct fc_ls_rjt_s *ls_rjt;
-
-	switch (els_cmd->els_code) {
-	case FC_ELS_LS_RJT:
-		ls_rjt = (struct fc_ls_rjt_s *) (fchs + 1);
-		if (ls_rjt->reason_code == FC_LS_RJT_RSN_LOGICAL_BUSY)
-			return FC_PARSE_BUSY;
-		else
-			return FC_PARSE_FAILURE;
-	case FC_ELS_ACC:
-		plogi = (struct fc_logi_s *) (fchs + 1);
-		if (len < sizeof(struct fc_logi_s))
-			return FC_PARSE_FAILURE;
-
-		if (!wwn_is_equal(plogi->port_name, port_name))
-			return FC_PARSE_FAILURE;
-
-		if (!plogi->class3.class_valid)
-			return FC_PARSE_FAILURE;
-
-		if (be16_to_cpu(plogi->class3.rxsz) < (FC_MIN_PDUSZ))
-			return FC_PARSE_FAILURE;
-
-		return FC_PARSE_OK;
-	default:
-		return FC_PARSE_FAILURE;
-	}
-}
-
-enum fc_parse_status
 fc_plogi_parse(struct fchs_s *fchs)
 {
 	struct fc_logi_s *plogi = (struct fc_logi_s *) (fchs + 1);
@@ -450,21 +339,6 @@ fc_prli_rsp_parse(struct fc_prli_s *prli, int len)
 	return FC_PARSE_OK;
 }
 
-enum fc_parse_status
-fc_prli_parse(struct fc_prli_s *prli)
-{
-	if (prli->parampage.type != FC_TYPE_FCP)
-		return FC_PARSE_FAILURE;
-
-	if (!prli->parampage.imagepair)
-		return FC_PARSE_FAILURE;
-
-	if (!prli->parampage.servparams.initiator)
-		return FC_PARSE_FAILURE;
-
-	return FC_PARSE_OK;
-}
-
 u16
 fc_logo_build(struct fchs_s *fchs, struct fc_logo_s *logo, u32 d_id, u32 s_id,
 	      u16 ox_id, wwn_t port_name)
@@ -535,84 +409,6 @@ fc_adisc_rsp_parse(struct fc_adisc_s *adisc, int len, wwn_t port_name,
 	return FC_PARSE_OK;
 }
 
-enum fc_parse_status
-fc_adisc_parse(struct fchs_s *fchs, void *pld, u32 host_dap, wwn_t node_name,
-	       wwn_t port_name)
-{
-	struct fc_adisc_s *adisc = (struct fc_adisc_s *) pld;
-
-	if (adisc->els_cmd.els_code != FC_ELS_ACC)
-		return FC_PARSE_FAILURE;
-
-	if ((adisc->nport_id == (host_dap))
-	    && wwn_is_equal(adisc->orig_port_name, port_name)
-	    && wwn_is_equal(adisc->orig_node_name, node_name))
-		return FC_PARSE_OK;
-
-	return FC_PARSE_FAILURE;
-}
-
-enum fc_parse_status
-fc_pdisc_parse(struct fchs_s *fchs, wwn_t node_name, wwn_t port_name)
-{
-	struct fc_logi_s *pdisc = (struct fc_logi_s *) (fchs + 1);
-
-	if (pdisc->class3.class_valid != 1)
-		return FC_PARSE_FAILURE;
-
-	if ((be16_to_cpu(pdisc->class3.rxsz) <
-		(FC_MIN_PDUSZ - sizeof(struct fchs_s)))
-	    || (pdisc->class3.rxsz == 0))
-		return FC_PARSE_FAILURE;
-
-	if (!wwn_is_equal(pdisc->port_name, port_name))
-		return FC_PARSE_FAILURE;
-
-	if (!wwn_is_equal(pdisc->node_name, node_name))
-		return FC_PARSE_FAILURE;
-
-	return FC_PARSE_OK;
-}
-
-u16
-fc_abts_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id)
-{
-	memcpy(fchs, &fc_bls_req_tmpl, sizeof(struct fchs_s));
-	fchs->cat_info = FC_CAT_ABTS;
-	fchs->d_id = (d_id);
-	fchs->s_id = (s_id);
-	fchs->ox_id = cpu_to_be16(ox_id);
-
-	return sizeof(struct fchs_s);
-}
-
-enum fc_parse_status
-fc_abts_rsp_parse(struct fchs_s *fchs, int len)
-{
-	if ((fchs->cat_info == FC_CAT_BA_ACC)
-	    || (fchs->cat_info == FC_CAT_BA_RJT))
-		return FC_PARSE_OK;
-
-	return FC_PARSE_FAILURE;
-}
-
-u16
-fc_rrq_build(struct fchs_s *fchs, struct fc_rrq_s *rrq, u32 d_id, u32 s_id,
-	     u16 ox_id, u16 rrq_oxid)
-{
-	fc_els_req_build(fchs, d_id, s_id, ox_id);
-
-	/*
-	 * build rrq payload
-	 */
-	memcpy(rrq, &rrq_tmpl, sizeof(struct fc_rrq_s));
-	rrq->s_id = (s_id);
-	rrq->ox_id = cpu_to_be16(rrq_oxid);
-	rrq->rx_id = FC_RXID_ANY;
-
-	return sizeof(struct fc_rrq_s);
-}
-
 u16
 fc_logo_acc_build(struct fchs_s *fchs, void *pld, u32 d_id, u32 s_id,
 		  __be16 ox_id)
@@ -670,47 +466,6 @@ fc_ls_acc_build(struct fchs_s *fchs, struct fc_els_cmd_s *els_cmd, u32 d_id,
 	return sizeof(struct fc_els_cmd_s);
 }
 
-int
-fc_logout_params_pages(struct fchs_s *fc_frame, u8 els_code)
-{
-	int             num_pages = 0;
-	struct fc_prlo_s *prlo;
-	struct fc_tprlo_s *tprlo;
-
-	if (els_code == FC_ELS_PRLO) {
-		prlo = (struct fc_prlo_s *) (fc_frame + 1);
-		num_pages = (be16_to_cpu(prlo->payload_len) - 4) / 16;
-	} else {
-		tprlo = (struct fc_tprlo_s *) (fc_frame + 1);
-		num_pages = (be16_to_cpu(tprlo->payload_len) - 4) / 16;
-	}
-	return num_pages;
-}
-
-u16
-fc_tprlo_acc_build(struct fchs_s *fchs, struct fc_tprlo_acc_s *tprlo_acc,
-		u32 d_id, u32 s_id, __be16 ox_id, int num_pages)
-{
-	int             page;
-
-	fc_els_rsp_build(fchs, d_id, s_id, ox_id);
-
-	memset(tprlo_acc, 0, (num_pages * 16) + 4);
-	tprlo_acc->command = FC_ELS_ACC;
-
-	tprlo_acc->page_len = 0x10;
-	tprlo_acc->payload_len = cpu_to_be16((num_pages * 16) + 4);
-
-	for (page = 0; page < num_pages; page++) {
-		tprlo_acc->tprlo_acc_params[page].opa_valid = 0;
-		tprlo_acc->tprlo_acc_params[page].rpa_valid = 0;
-		tprlo_acc->tprlo_acc_params[page].fc4type_csp = FC_TYPE_FCP;
-		tprlo_acc->tprlo_acc_params[page].orig_process_assc = 0;
-		tprlo_acc->tprlo_acc_params[page].resp_process_assc = 0;
-	}
-	return be16_to_cpu(tprlo_acc->payload_len);
-}
-
 u16
 fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc, u32 d_id,
 		  u32 s_id, __be16 ox_id, int num_pages)
@@ -736,20 +491,6 @@ fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc, u32 d_id,
 }
 
 u16
-fc_rnid_build(struct fchs_s *fchs, struct fc_rnid_cmd_s *rnid, u32 d_id,
-		u32 s_id, u16 ox_id, u32 data_format)
-{
-	fc_els_req_build(fchs, d_id, s_id, ox_id);
-
-	memset(rnid, 0, sizeof(struct fc_rnid_cmd_s));
-
-	rnid->els_cmd.els_code = FC_ELS_RNID;
-	rnid->node_id_data_format = data_format;
-
-	return sizeof(struct fc_rnid_cmd_s);
-}
-
-u16
 fc_rnid_acc_build(struct fchs_s *fchs, struct fc_rnid_acc_s *rnid_acc, u32 d_id,
 		  u32 s_id, __be16 ox_id, u32 data_format,
 		  struct fc_rnid_common_id_data_s *common_id_data,
@@ -778,18 +519,6 @@ fc_rnid_acc_build(struct fchs_s *fchs, struct fc_rnid_acc_s *rnid_acc, u32 d_id,
 }
 
 u16
-fc_rpsc_build(struct fchs_s *fchs, struct fc_rpsc_cmd_s *rpsc, u32 d_id,
-		u32 s_id, u16 ox_id)
-{
-	fc_els_req_build(fchs, d_id, s_id, ox_id);
-
-	memset(rpsc, 0, sizeof(struct fc_rpsc_cmd_s));
-
-	rpsc->els_cmd.els_code = FC_ELS_RPSC;
-	return sizeof(struct fc_rpsc_cmd_s);
-}
-
-u16
 fc_rpsc2_build(struct fchs_s *fchs, struct fc_rpsc2_cmd_s *rpsc2, u32 d_id,
 		u32 s_id, u32 *pid_list, u16 npids)
 {
@@ -830,202 +559,6 @@ fc_rpsc_acc_build(struct fchs_s *fchs, struct fc_rpsc_acc_s *rpsc_acc,
 	return sizeof(struct fc_rpsc_acc_s);
 }
 
-u16
-fc_logo_rsp_parse(struct fchs_s *fchs, int len)
-{
-	struct fc_els_cmd_s *els_cmd = (struct fc_els_cmd_s *) (fchs + 1);
-
-	len = len;
-	if (els_cmd->els_code != FC_ELS_ACC)
-		return FC_PARSE_FAILURE;
-
-	return FC_PARSE_OK;
-}
-
-u16
-fc_pdisc_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id,
-	       wwn_t port_name, wwn_t node_name, u16 pdu_size)
-{
-	struct fc_logi_s *pdisc = (struct fc_logi_s *) (fchs + 1);
-
-	memcpy(pdisc, &plogi_tmpl, sizeof(struct fc_logi_s));
-
-	pdisc->els_cmd.els_code = FC_ELS_PDISC;
-	fc_els_req_build(fchs, d_id, s_id, ox_id);
-
-	pdisc->csp.rxsz = pdisc->class3.rxsz = cpu_to_be16(pdu_size);
-	pdisc->port_name = port_name;
-	pdisc->node_name = node_name;
-
-	return sizeof(struct fc_logi_s);
-}
-
-u16
-fc_pdisc_rsp_parse(struct fchs_s *fchs, int len, wwn_t port_name)
-{
-	struct fc_logi_s *pdisc = (struct fc_logi_s *) (fchs + 1);
-
-	if (len < sizeof(struct fc_logi_s))
-		return FC_PARSE_LEN_INVAL;
-
-	if (pdisc->els_cmd.els_code != FC_ELS_ACC)
-		return FC_PARSE_ACC_INVAL;
-
-	if (!wwn_is_equal(pdisc->port_name, port_name))
-		return FC_PARSE_PWWN_NOT_EQUAL;
-
-	if (!pdisc->class3.class_valid)
-		return FC_PARSE_NWWN_NOT_EQUAL;
-
-	if (be16_to_cpu(pdisc->class3.rxsz) < (FC_MIN_PDUSZ))
-		return FC_PARSE_RXSZ_INVAL;
-
-	return FC_PARSE_OK;
-}
-
-u16
-fc_prlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id,
-	      int num_pages)
-{
-	struct fc_prlo_s *prlo = (struct fc_prlo_s *) (fchs + 1);
-	int             page;
-
-	fc_els_req_build(fchs, d_id, s_id, ox_id);
-	memset(prlo, 0, (num_pages * 16) + 4);
-	prlo->command = FC_ELS_PRLO;
-	prlo->page_len = 0x10;
-	prlo->payload_len = cpu_to_be16((num_pages * 16) + 4);
-
-	for (page = 0; page < num_pages; page++) {
-		prlo->prlo_params[page].type = FC_TYPE_FCP;
-		prlo->prlo_params[page].opa_valid = 0;
-		prlo->prlo_params[page].rpa_valid = 0;
-		prlo->prlo_params[page].orig_process_assc = 0;
-		prlo->prlo_params[page].resp_process_assc = 0;
-	}
-
-	return be16_to_cpu(prlo->payload_len);
-}
-
-u16
-fc_prlo_rsp_parse(struct fchs_s *fchs, int len)
-{
-	struct fc_prlo_acc_s *prlo = (struct fc_prlo_acc_s *) (fchs + 1);
-	int             num_pages = 0;
-	int             page = 0;
-
-	len = len;
-
-	if (prlo->command != FC_ELS_ACC)
-		return FC_PARSE_FAILURE;
-
-	num_pages = ((be16_to_cpu(prlo->payload_len)) - 4) / 16;
-
-	for (page = 0; page < num_pages; page++) {
-		if (prlo->prlo_acc_params[page].type != FC_TYPE_FCP)
-			return FC_PARSE_FAILURE;
-
-		if (prlo->prlo_acc_params[page].opa_valid != 0)
-			return FC_PARSE_FAILURE;
-
-		if (prlo->prlo_acc_params[page].rpa_valid != 0)
-			return FC_PARSE_FAILURE;
-
-		if (prlo->prlo_acc_params[page].orig_process_assc != 0)
-			return FC_PARSE_FAILURE;
-
-		if (prlo->prlo_acc_params[page].resp_process_assc != 0)
-			return FC_PARSE_FAILURE;
-	}
-	return FC_PARSE_OK;
-
-}
-
-u16
-fc_tprlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id,
-	       int num_pages, enum fc_tprlo_type tprlo_type, u32 tpr_id)
-{
-	struct fc_tprlo_s *tprlo = (struct fc_tprlo_s *) (fchs + 1);
-	int             page;
-
-	fc_els_req_build(fchs, d_id, s_id, ox_id);
-	memset(tprlo, 0, (num_pages * 16) + 4);
-	tprlo->command = FC_ELS_TPRLO;
-	tprlo->page_len = 0x10;
-	tprlo->payload_len = cpu_to_be16((num_pages * 16) + 4);
-
-	for (page = 0; page < num_pages; page++) {
-		tprlo->tprlo_params[page].type = FC_TYPE_FCP;
-		tprlo->tprlo_params[page].opa_valid = 0;
-		tprlo->tprlo_params[page].rpa_valid = 0;
-		tprlo->tprlo_params[page].orig_process_assc = 0;
-		tprlo->tprlo_params[page].resp_process_assc = 0;
-		if (tprlo_type == FC_GLOBAL_LOGO) {
-			tprlo->tprlo_params[page].global_process_logout = 1;
-		} else if (tprlo_type == FC_TPR_LOGO) {
-			tprlo->tprlo_params[page].tpo_nport_valid = 1;
-			tprlo->tprlo_params[page].tpo_nport_id = (tpr_id);
-		}
-	}
-
-	return be16_to_cpu(tprlo->payload_len);
-}
-
-u16
-fc_tprlo_rsp_parse(struct fchs_s *fchs, int len)
-{
-	struct fc_tprlo_acc_s *tprlo = (struct fc_tprlo_acc_s *) (fchs + 1);
-	int             num_pages = 0;
-	int             page = 0;
-
-	len = len;
-
-	if (tprlo->command != FC_ELS_ACC)
-		return FC_PARSE_ACC_INVAL;
-
-	num_pages = (be16_to_cpu(tprlo->payload_len) - 4) / 16;
-
-	for (page = 0; page < num_pages; page++) {
-		if (tprlo->tprlo_acc_params[page].type != FC_TYPE_FCP)
-			return FC_PARSE_NOT_FCP;
-		if (tprlo->tprlo_acc_params[page].opa_valid != 0)
-			return FC_PARSE_OPAFLAG_INVAL;
-		if (tprlo->tprlo_acc_params[page].rpa_valid != 0)
-			return FC_PARSE_RPAFLAG_INVAL;
-		if (tprlo->tprlo_acc_params[page].orig_process_assc != 0)
-			return FC_PARSE_OPA_INVAL;
-		if (tprlo->tprlo_acc_params[page].resp_process_assc != 0)
-			return FC_PARSE_RPA_INVAL;
-	}
-	return FC_PARSE_OK;
-}
-
-enum fc_parse_status
-fc_rrq_rsp_parse(struct fchs_s *fchs, int len)
-{
-	struct fc_els_cmd_s *els_cmd = (struct fc_els_cmd_s *) (fchs + 1);
-
-	len = len;
-	if (els_cmd->els_code != FC_ELS_ACC)
-		return FC_PARSE_FAILURE;
-
-	return FC_PARSE_OK;
-}
-
-u16
-fc_ba_rjt_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id,
-		u32 reason_code, u32 reason_expl)
-{
-	struct fc_ba_rjt_s *ba_rjt = (struct fc_ba_rjt_s *) (fchs + 1);
-
-	fc_bls_rsp_build(fchs, d_id, s_id, ox_id);
-
-	fchs->cat_info = FC_CAT_BA_RJT;
-	ba_rjt->reason_code = reason_code;
-	ba_rjt->reason_expl = reason_expl;
-	return sizeof(struct fc_ba_rjt_s);
-}
-
 static void
 fc_gs_cthdr_build(struct ct_hdr_s *cthdr, u32 s_id, u16 cmd_code)
 {
@@ -1090,35 +623,6 @@ fc_gpnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
 }
 
 u16
-fc_gnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
-	       u32 port_id)
-{
-	struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
-	fcgs_gnnid_req_t *gnnid = (fcgs_gnnid_req_t *) (cthdr + 1);
-	u32        d_id = bfa_hton3b(FC_NAME_SERVER);
-
-	fc_gs_fchdr_build(fchs, d_id, s_id, ox_id);
-	fc_gs_cthdr_build(cthdr, s_id, GS_GNN_ID);
-
-	memset(gnnid, 0, sizeof(fcgs_gnnid_req_t));
-	gnnid->dap = port_id;
-	return sizeof(fcgs_gnnid_req_t) + sizeof(struct ct_hdr_s);
-}
-
-u16
-fc_ct_rsp_parse(struct ct_hdr_s *cthdr)
-{
-	if (be16_to_cpu(cthdr->cmd_rsp_code) != CT_RSP_ACCEPT) {
-		if (cthdr->reason_code == CT_RSN_LOGICAL_BUSY)
-			return FC_PARSE_BUSY;
-		else
-			return FC_PARSE_FAILURE;
-	}
-
-	return FC_PARSE_OK;
-}
-
-u16
 fc_gs_rjt_build(struct fchs_s *fchs,  struct ct_hdr_s *cthdr,
 		u32 d_id, u32 s_id, u16 ox_id, u8 reason_code,
 		u8 reason_code_expl)
@@ -1151,26 +655,6 @@ fc_scr_build(struct fchs_s *fchs, struct fc_scr_s *scr,
 }
 
 u16
-fc_rscn_build(struct fchs_s *fchs, struct fc_rscn_pl_s *rscn,
-		u32 s_id, u16 ox_id)
-{
-	u32        d_id = bfa_hton3b(FC_FABRIC_CONTROLLER);
-	u16        payldlen;
-
-	fc_els_req_build(fchs, d_id, s_id, ox_id);
-	rscn->command = FC_ELS_RSCN;
-	rscn->pagelen = sizeof(rscn->event[0]);
-
-	payldlen = sizeof(u32) + rscn->pagelen;
-	rscn->payldlen = cpu_to_be16(payldlen);
-
-	rscn->event[0].format = FC_RSCN_FORMAT_PORTID;
-	rscn->event[0].portid = s_id;
-
-	return sizeof(struct fc_rscn_pl_s);
-}
-
-u16
 fc_rftid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
 	       enum bfa_lport_role roles)
 {
@@ -1195,26 +679,6 @@ fc_rftid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
 }
 
 u16
-fc_rftid_build_sol(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
-		   u8 *fc4_bitmap, u32 bitmap_size)
-{
-	struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
-	struct fcgs_rftid_req_s *rftid = (struct fcgs_rftid_req_s *)(cthdr + 1);
-	u32        d_id = bfa_hton3b(FC_NAME_SERVER);
-
-	fc_gs_fchdr_build(fchs, d_id, s_id, ox_id);
-	fc_gs_cthdr_build(cthdr, s_id, GS_RFT_ID);
-
-	memset(rftid, 0, sizeof(struct fcgs_rftid_req_s));
-
-	rftid->dap = s_id;
-	memcpy((void *)rftid->fc4_type, (void *)fc4_bitmap,
-		(bitmap_size < 32 ? bitmap_size : 32));
-
-	return sizeof(struct fcgs_rftid_req_s) + sizeof(struct ct_hdr_s);
-}
-
-u16
 fc_rffid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
 	       u8 fc4_type, u8 fc4_ftrs)
 {
@@ -1298,24 +762,6 @@ fc_gid_ft_build(struct fchs_s *fchs, void *pyld, u32 s_id, u8 fc4_type)
 }
 
 u16
-fc_rpnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id,
-	       wwn_t port_name)
-{
-	struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
-	struct fcgs_rpnid_req_s *rpnid = (struct fcgs_rpnid_req_s *)(cthdr + 1);
-	u32        d_id = bfa_hton3b(FC_NAME_SERVER);
-
-	fc_gs_fchdr_build(fchs, d_id, s_id, 0);
-	fc_gs_cthdr_build(cthdr, s_id, GS_RPN_ID);
-
-	memset(rpnid, 0, sizeof(struct fcgs_rpnid_req_s));
-	rpnid->port_id = port_id;
-	rpnid->port_name = port_name;
-
-	return sizeof(struct fcgs_rpnid_req_s) + sizeof(struct ct_hdr_s);
-}
-
-u16
 fc_rnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id,
 	       wwn_t node_name)
 {
@@ -1333,59 +779,6 @@ fc_rnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id,
 	return sizeof(struct fcgs_rnnid_req_s) + sizeof(struct ct_hdr_s);
 }
 
-u16
-fc_rcsid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id,
-	       u32 cos)
-{
-	struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
-	struct fcgs_rcsid_req_s *rcsid =
-			(struct fcgs_rcsid_req_s *) (cthdr + 1);
-	u32        d_id = bfa_hton3b(FC_NAME_SERVER);
-
-	fc_gs_fchdr_build(fchs, d_id, s_id, 0);
-	fc_gs_cthdr_build(cthdr, s_id, GS_RCS_ID);
-
-	memset(rcsid, 0, sizeof(struct fcgs_rcsid_req_s));
-	rcsid->port_id = port_id;
-	rcsid->cos = cos;
-
-	return sizeof(struct fcgs_rcsid_req_s) + sizeof(struct ct_hdr_s);
-}
-
-u16
-fc_rptid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id,
-	       u8 port_type)
-{
-	struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
-	struct fcgs_rptid_req_s *rptid = (struct fcgs_rptid_req_s *)(cthdr + 1);
-	u32        d_id = bfa_hton3b(FC_NAME_SERVER);
-
-	fc_gs_fchdr_build(fchs, d_id, s_id, 0);
-	fc_gs_cthdr_build(cthdr, s_id, GS_RPT_ID);
-
-	memset(rptid, 0, sizeof(struct fcgs_rptid_req_s));
-	rptid->port_id = port_id;
-	rptid->port_type = port_type;
-
-	return sizeof(struct fcgs_rptid_req_s) + sizeof(struct ct_hdr_s);
-}
-
-u16
-fc_ganxt_build(struct fchs_s *fchs, void *pyld, u32 s_id, u32 port_id)
-{
-	struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
-	struct fcgs_ganxt_req_s *ganxt = (struct fcgs_ganxt_req_s *)(cthdr + 1);
-	u32        d_id = bfa_hton3b(FC_NAME_SERVER);
-
-	fc_gs_fchdr_build(fchs, d_id, s_id, 0);
-	fc_gs_cthdr_build(cthdr, s_id, GS_GA_NXT);
-
-	memset(ganxt, 0, sizeof(struct fcgs_ganxt_req_s));
-	ganxt->port_id = port_id;
-
-	return sizeof(struct ct_hdr_s) + sizeof(struct fcgs_ganxt_req_s);
-}
-
 /*
  * Builds fc hdr and ct hdr for FDMI requests.
  */
diff --git a/drivers/scsi/bfa/bfa_fcbuild.h b/drivers/scsi/bfa/bfa_fcbuild.h
index 433316fa72fa..c1dbadf6f70d 100644
--- a/drivers/scsi/bfa/bfa_fcbuild.h
+++ b/drivers/scsi/bfa/bfa_fcbuild.h
@@ -135,15 +135,6 @@ struct fc_templates_s {
 
 void            fcbuild_init(void);
 
-u16        fc_flogi_build(struct fchs_s *fchs, struct fc_logi_s *flogi,
-			u32 s_id, u16 ox_id, wwn_t port_name, wwn_t node_name,
-			       u16 pdu_size, u8 set_npiv, u8 set_auth,
-			       u16 local_bb_credits);
-
-u16        fc_fdisc_build(struct fchs_s *buf, struct fc_logi_s *flogi, u32 s_id,
-			       u16 ox_id, wwn_t port_name, wwn_t node_name,
-			       u16 pdu_size);
-
 u16        fc_flogi_acc_build(struct fchs_s *fchs, struct fc_logi_s *flogi,
 				   u32 s_id, __be16 ox_id,
 				   wwn_t port_name, wwn_t node_name,
@@ -156,15 +147,6 @@ u16        fc_plogi_build(struct fchs_s *fchs, void *pld, u32 d_id,
 
 enum fc_parse_status fc_plogi_parse(struct fchs_s *fchs);
 
-u16        fc_abts_build(struct fchs_s *buf, u32 d_id, u32 s_id,
-			      u16 ox_id);
-
-enum fc_parse_status fc_abts_rsp_parse(struct fchs_s *buf, int len);
-
-u16        fc_rrq_build(struct fchs_s *buf, struct fc_rrq_s *rrq, u32 d_id,
-			     u32 s_id, u16 ox_id, u16 rrq_oxid);
-enum fc_parse_status fc_rrq_rsp_parse(struct fchs_s *buf, int len);
-
 u16        fc_rspnid_build(struct fchs_s *fchs, void *pld, u32 s_id,
 				u16 ox_id, u8 *name);
 u16	fc_rsnn_nn_build(struct fchs_s *fchs, void *pld, u32 s_id,
@@ -173,10 +155,6 @@ u16	fc_rsnn_nn_build(struct fchs_s *fchs, void *pld, u32 s_id,
 u16        fc_rftid_build(struct fchs_s *fchs, void *pld, u32 s_id,
 			       u16 ox_id, enum bfa_lport_role role);
 
-u16       fc_rftid_build_sol(struct fchs_s *fchs, void *pyld, u32 s_id,
-				   u16 ox_id, u8 *fc4_bitmap,
-				   u32 bitmap_size);
-
 u16	fc_rffid_build(struct fchs_s *fchs, void *pyld, u32 s_id,
 			u16 ox_id, u8 fc4_type, u8 fc4_ftrs);
 
@@ -202,9 +180,6 @@ u16        fc_adisc_build(struct fchs_s *fchs, struct fc_adisc_s *adisc,
 			u32 d_id, u32 s_id, __be16 ox_id, wwn_t port_name,
 			       wwn_t node_name);
 
-enum fc_parse_status fc_adisc_parse(struct fchs_s *fchs, void *pld,
-			u32 host_dap, wwn_t node_name, wwn_t port_name);
-
 enum fc_parse_status fc_adisc_rsp_parse(struct fc_adisc_s *adisc, int len,
 				 wwn_t port_name, wwn_t node_name);
 
@@ -225,10 +200,6 @@ u16        fc_prli_acc_build(struct fchs_s *fchs, void *pld, u32 d_id,
 				  u32 s_id, __be16 ox_id,
 				  enum bfa_lport_role role);
 
-u16        fc_rnid_build(struct fchs_s *fchs, struct fc_rnid_cmd_s *rnid,
-			      u32 d_id, u32 s_id, u16 ox_id,
-			      u32 data_format);
-
 u16        fc_rnid_acc_build(struct fchs_s *fchs,
 			struct fc_rnid_acc_s *rnid_acc, u32 d_id, u32 s_id,
 			__be16 ox_id, u32 data_format,
@@ -237,29 +208,15 @@ u16        fc_rnid_acc_build(struct fchs_s *fchs,
 
 u16	fc_rpsc2_build(struct fchs_s *fchs, struct fc_rpsc2_cmd_s *rps2c,
 			u32 d_id, u32 s_id, u32 *pid_list, u16 npids);
-u16        fc_rpsc_build(struct fchs_s *fchs, struct fc_rpsc_cmd_s *rpsc,
-			      u32 d_id, u32 s_id, u16 ox_id);
 u16        fc_rpsc_acc_build(struct fchs_s *fchs,
 			struct fc_rpsc_acc_s *rpsc_acc, u32 d_id, u32 s_id,
 			__be16 ox_id, struct fc_rpsc_speed_info_s *oper_speed);
 u16        fc_gid_ft_build(struct fchs_s *fchs, void *pld, u32 s_id,
 				u8 fc4_type);
 
-u16        fc_rpnid_build(struct fchs_s *fchs, void *pyld, u32 s_id,
-			       u32 port_id, wwn_t port_name);
-
 u16        fc_rnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id,
 			       u32 port_id, wwn_t node_name);
 
-u16        fc_rcsid_build(struct fchs_s *fchs, void *pyld, u32 s_id,
-			       u32 port_id, u32 cos);
-
-u16        fc_rptid_build(struct fchs_s *fchs, void *pyld, u32 s_id,
-			       u32 port_id, u8 port_type);
-
-u16        fc_ganxt_build(struct fchs_s *fchs, void *pyld, u32 s_id,
-			       u32 port_id);
-
 u16        fc_logo_build(struct fchs_s *fchs, struct fc_logo_s *logo, u32 d_id,
 			      u32 s_id, u16 ox_id, wwn_t port_name);
 
@@ -273,54 +230,10 @@ u16	fc_gfn_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn);
 
 void		fc_get_fc4type_bitmask(u8 fc4_type, u8 *bit_mask);
 
-enum fc_parse_status	fc_els_rsp_parse(struct fchs_s *fchs, int len);
-
-enum fc_parse_status	fc_plogi_rsp_parse(struct fchs_s *fchs, int len,
-					wwn_t port_name);
-
-enum fc_parse_status	fc_prli_parse(struct fc_prli_s *prli);
-
-enum fc_parse_status	fc_pdisc_parse(struct fchs_s *fchs, wwn_t node_name,
-					wwn_t port_name);
-
 u16 fc_ba_acc_build(struct fchs_s *fchs, struct fc_ba_acc_s *ba_acc, u32 d_id,
 		u32 s_id, __be16 ox_id, u16 rx_id);
 
-int fc_logout_params_pages(struct fchs_s *fc_frame, u8 els_code);
-
-u16 fc_tprlo_acc_build(struct fchs_s *fchs, struct fc_tprlo_acc_s *tprlo_acc,
-		u32 d_id, u32 s_id, __be16 ox_id, int num_pages);
-
 u16 fc_prlo_acc_build(struct fchs_s *fchs, struct fc_prlo_acc_s *prlo_acc,
 		u32 d_id, u32 s_id, __be16 ox_id, int num_pages);
 
-u16 fc_logo_rsp_parse(struct fchs_s *fchs, int len);
-
-u16 fc_pdisc_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
-		u16 ox_id, wwn_t port_name, wwn_t node_name,
-		u16 pdu_size);
-
-u16 fc_pdisc_rsp_parse(struct fchs_s *fchs, int len, wwn_t port_name);
-
-u16 fc_prlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
-		u16 ox_id, int num_pages);
-
-u16 fc_prlo_rsp_parse(struct fchs_s *fchs, int len);
-
-u16 fc_tprlo_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
-		u16 ox_id, int num_pages, enum fc_tprlo_type tprlo_type,
-		u32 tpr_id);
-
-u16 fc_tprlo_rsp_parse(struct fchs_s *fchs, int len);
-
-u16 fc_ba_rjt_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
-		__be16 ox_id, u32 reason_code, u32 reason_expl);
-
-u16 fc_gnnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
-		u32 port_id);
-
-u16 fc_ct_rsp_parse(struct ct_hdr_s *cthdr);
-
-u16 fc_rscn_build(struct fchs_s *fchs, struct fc_rscn_pl_s *rscn, u32 s_id,
-		u16 ox_id);
 #endif
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/5] bfa: remove more unused functions
  2016-08-02 15:22 [PATCH 0/5] bfa: fix W=1 build warnings Arnd Bergmann
                   ` (3 preceding siblings ...)
  2016-08-02 15:22 ` [PATCH 4/5] bfa: remove unused functions from fbbuild.c Arnd Bergmann
@ 2016-08-02 15:22 ` Arnd Bergmann
  2016-08-10  5:28 ` [PATCH 0/5] bfa: fix W=1 build warnings Sudarsana Kalluru
  5 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2016-08-02 15:22 UTC (permalink / raw)
  To: Anil Gurumurthy, Sudarsana Kalluru
  Cc: James E . J . Bottomley, Martin K . Petersen, linux-scsi,
	linux-kernel, Baoyou Xie, Arnd Bergmann

This is a collection of additional functions that are not called anywhere
in the driver, all being removed in this patch.

Alternatively, we could mark them as 'static __maybe_unused', to leave
the implementation around but not cause them to end up in the object
code.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/bfa/bfa.h           |   2 -
 drivers/scsi/bfa/bfa_core.c      |  35 ----------
 drivers/scsi/bfa/bfa_fcpim.c     |   9 ---
 drivers/scsi/bfa/bfa_fcpim.h     |   1 -
 drivers/scsi/bfa/bfa_fcs.h       |  13 ----
 drivers/scsi/bfa/bfa_fcs_lport.c | 142 ---------------------------------------
 drivers/scsi/bfa/bfa_fcs_rport.c |  36 ----------
 drivers/scsi/bfa/bfa_ioc.c       |  21 ------
 drivers/scsi/bfa/bfa_ioc.h       |   2 -
 drivers/scsi/bfa/bfa_svc.c       |  54 ---------------
 drivers/scsi/bfa/bfa_svc.h       |   5 --
 drivers/scsi/bfa/bfad.c          |  20 ------
 drivers/scsi/bfa/bfad_drv.h      |   1 -
 13 files changed, 341 deletions(-)

diff --git a/drivers/scsi/bfa/bfa.h b/drivers/scsi/bfa/bfa.h
index c3b499d126d5..a61b23489e55 100644
--- a/drivers/scsi/bfa/bfa.h
+++ b/drivers/scsi/bfa/bfa.h
@@ -386,9 +386,7 @@ int bfa_iocfc_get_pbc_vports(struct bfa_s *bfa,
 	(((&(_bfa)->modules.dconf_mod)->min_cfg)		\
 	 ? BFA_LUNMASK_MINCFG : ((bfa_get_lun_mask(_bfa))->status))
 
-void bfa_get_pciids(struct bfa_pciid_s **pciids, int *npciids);
 void bfa_cfg_get_default(struct bfa_iocfc_cfg_s *cfg);
-void bfa_cfg_get_min(struct bfa_iocfc_cfg_s *cfg);
 void bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg,
 			struct bfa_meminfo_s *meminfo,
 			struct bfa_s *bfa);
diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c
index 75c6db27a399..5385c277b49d 100644
--- a/drivers/scsi/bfa/bfa_core.c
+++ b/drivers/scsi/bfa/bfa_core.c
@@ -1953,24 +1953,6 @@ bfa_comp_free(struct bfa_s *bfa, struct list_head *comp_q)
 }
 
 /*
- * Return the list of PCI vendor/device id lists supported by this
- * BFA instance.
- */
-void
-bfa_get_pciids(struct bfa_pciid_s **pciids, int *npciids)
-{
-	static struct bfa_pciid_s __pciids[] = {
-		{BFA_PCI_VENDOR_ID_BROCADE, BFA_PCI_DEVICE_ID_FC_8G2P},
-		{BFA_PCI_VENDOR_ID_BROCADE, BFA_PCI_DEVICE_ID_FC_8G1P},
-		{BFA_PCI_VENDOR_ID_BROCADE, BFA_PCI_DEVICE_ID_CT},
-		{BFA_PCI_VENDOR_ID_BROCADE, BFA_PCI_DEVICE_ID_CT_FC},
-	};
-
-	*npciids = sizeof(__pciids) / sizeof(__pciids[0]);
-	*pciids = __pciids;
-}
-
-/*
  * Use this function query the default struct bfa_iocfc_cfg_s value (compiled
  * into BFA layer). The OS driver can then turn back and overwrite entries that
  * have been configured by the user.
@@ -2006,20 +1988,3 @@ bfa_cfg_get_default(struct bfa_iocfc_cfg_s *cfg)
 	cfg->drvcfg.delay_comp = BFA_FALSE;
 
 }
-
-void
-bfa_cfg_get_min(struct bfa_iocfc_cfg_s *cfg)
-{
-	bfa_cfg_get_default(cfg);
-	cfg->fwcfg.num_ioim_reqs   = BFA_IOIM_MIN;
-	cfg->fwcfg.num_tskim_reqs  = BFA_TSKIM_MIN;
-	cfg->fwcfg.num_fcxp_reqs   = BFA_FCXP_MIN;
-	cfg->fwcfg.num_uf_bufs     = BFA_UF_MIN;
-	cfg->fwcfg.num_rports      = BFA_RPORT_MIN;
-	cfg->fwcfg.num_fwtio_reqs = 0;
-
-	cfg->drvcfg.num_sgpgs      = BFA_SGPG_MIN;
-	cfg->drvcfg.num_reqq_elems = BFA_REQQ_NELEMS_MIN;
-	cfg->drvcfg.num_rspq_elems = BFA_RSPQ_NELEMS_MIN;
-	cfg->drvcfg.min_cfg	   = BFA_TRUE;
-}
diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c
index 6dc3e8afa652..5853c163f8cf 100644
--- a/drivers/scsi/bfa/bfa_fcpim.c
+++ b/drivers/scsi/bfa/bfa_fcpim.c
@@ -3494,15 +3494,6 @@ bfa_tskim_iocdisable_ios(struct bfa_tskim_s *tskim)
 }
 
 /*
- * Notification on completions from related ioim.
- */
-void
-bfa_tskim_iodone(struct bfa_tskim_s *tskim)
-{
-	bfa_wc_down(&tskim->wc);
-}
-
-/*
  * Handle IOC h/w failure notification from itnim.
  */
 static void
diff --git a/drivers/scsi/bfa/bfa_fcpim.h b/drivers/scsi/bfa/bfa_fcpim.h
index c3dfd26350c2..9dbd300bd84d 100644
--- a/drivers/scsi/bfa/bfa_fcpim.h
+++ b/drivers/scsi/bfa/bfa_fcpim.h
@@ -277,7 +277,6 @@ void	bfa_ioim_good_comp_isr(struct bfa_s *bfa,
 					struct bfi_msg_s *msg);
 
 void	bfa_tskim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
-void	bfa_tskim_iodone(struct bfa_tskim_s *tskim);
 void	bfa_tskim_res_recfg(struct bfa_s *bfa, u16 num_tskim_fw);
 
 /*
diff --git a/drivers/scsi/bfa/bfa_fcs.h b/drivers/scsi/bfa/bfa_fcs.h
index 5409a1cfb688..f60039e95c78 100644
--- a/drivers/scsi/bfa/bfa_fcs.h
+++ b/drivers/scsi/bfa/bfa_fcs.h
@@ -291,15 +291,10 @@ bfa_boolean_t   bfa_fcs_lport_is_online(struct bfa_fcs_lport_s *port);
 struct bfa_fcs_lport_s *bfa_fcs_get_base_port(struct bfa_fcs_s *fcs);
 void bfa_fcs_lport_get_rport_quals(struct bfa_fcs_lport_s *port,
 			struct bfa_rport_qualifier_s rport[], int *nrports);
-wwn_t bfa_fcs_lport_get_rport(struct bfa_fcs_lport_s *port, wwn_t wwn,
-			      int index, int nrports, bfa_boolean_t bwwn);
-
 struct bfa_fcs_lport_s *bfa_fcs_lookup_port(struct bfa_fcs_s *fcs,
 					    u16 vf_id, wwn_t lpwwn);
 
 void bfa_fcs_lport_set_symname(struct bfa_fcs_lport_s *port, char *symname);
-void bfa_fcs_lport_get_info(struct bfa_fcs_lport_s *port,
-			    struct bfa_lport_info_s *port_info);
 void bfa_fcs_lport_get_attr(struct bfa_fcs_lport_s *port,
 			    struct bfa_lport_attr_s *port_attr);
 void bfa_fcs_lport_get_stats(struct bfa_fcs_lport_s *fcs_port,
@@ -321,8 +316,6 @@ void            bfa_fcs_lport_delete(struct bfa_fcs_lport_s *port);
 void		bfa_fcs_lport_stop(struct bfa_fcs_lport_s *port);
 struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_pwwn(
 		struct bfa_fcs_lport_s *port, wwn_t pwwn);
-struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_nwwn(
-		struct bfa_fcs_lport_s *port, wwn_t nwwn);
 struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_qualifier(
 		struct bfa_fcs_lport_s *port, wwn_t pwwn, u32 pid);
 void            bfa_fcs_lport_add_rport(struct bfa_fcs_lport_s *port,
@@ -356,7 +349,6 @@ bfa_status_t bfa_fcs_pbc_vport_create(struct bfa_fcs_vport_s *vport,
 				      struct bfa_fcs_s *fcs, u16 vf_id,
 				      struct bfa_lport_cfg_s *port_cfg,
 				      struct bfad_vport_s *vport_drv);
-bfa_boolean_t bfa_fcs_is_pbc_vport(struct bfa_fcs_vport_s *vport);
 bfa_status_t bfa_fcs_vport_delete(struct bfa_fcs_vport_s *vport);
 bfa_status_t bfa_fcs_vport_start(struct bfa_fcs_vport_s *vport);
 bfa_status_t bfa_fcs_vport_stop(struct bfa_fcs_vport_s *vport);
@@ -364,7 +356,6 @@ void bfa_fcs_vport_get_attr(struct bfa_fcs_vport_s *vport,
 			    struct bfa_vport_attr_s *vport_attr);
 struct bfa_fcs_vport_s *bfa_fcs_vport_lookup(struct bfa_fcs_s *fcs,
 					     u16 vf_id, wwn_t vpwwn);
-void bfa_fcs_vport_cleanup(struct bfa_fcs_vport_s *vport);
 void bfa_fcs_vport_online(struct bfa_fcs_vport_s *vport);
 void bfa_fcs_vport_offline(struct bfa_fcs_vport_s *vport);
 void bfa_fcs_vport_fcs_delete(struct bfa_fcs_vport_s *vport);
@@ -444,8 +435,6 @@ void bfa_fcs_rport_get_attr(struct bfa_fcs_rport_s *rport,
 			struct bfa_rport_attr_s *attr);
 struct bfa_fcs_rport_s *bfa_fcs_rport_lookup(struct bfa_fcs_lport_s *port,
 					     wwn_t rpwwn);
-struct bfa_fcs_rport_s *bfa_fcs_rport_lookup_by_nwwn(
-	struct bfa_fcs_lport_s *port, wwn_t rnwwn);
 void bfa_fcs_rport_set_del_timeout(u8 rport_tmo);
 void bfa_fcs_rport_set_max_logins(u32 max_logins);
 void bfa_fcs_rport_uf_recv(struct bfa_fcs_rport_s *rport,
@@ -454,8 +443,6 @@ void bfa_fcs_rport_scn(struct bfa_fcs_rport_s *rport);
 
 struct bfa_fcs_rport_s *bfa_fcs_rport_create(struct bfa_fcs_lport_s *port,
 	 u32 pid);
-void bfa_fcs_rport_start(struct bfa_fcs_lport_s *port, struct fchs_s *rx_fchs,
-			 struct fc_logi_s *plogi_rsp);
 void bfa_fcs_rport_plogi_create(struct bfa_fcs_lport_s *port,
 				struct fchs_s *rx_fchs,
 				struct fc_logi_s *plogi);
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index 7870baedb9bd..b7e6183a016f 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -970,25 +970,6 @@ bfa_fcs_lport_get_rport_by_pwwn(struct bfa_fcs_lport_s *port, wwn_t pwwn)
 }
 
 /*
- *   NWWN based Lookup for a R-Port in the Port R-Port Queue
- */
-struct bfa_fcs_rport_s *
-bfa_fcs_lport_get_rport_by_nwwn(struct bfa_fcs_lport_s *port, wwn_t nwwn)
-{
-	struct bfa_fcs_rport_s *rport;
-	struct list_head	*qe;
-
-	list_for_each(qe, &port->rport_q) {
-		rport = (struct bfa_fcs_rport_s *) qe;
-		if (wwn_is_equal(rport->nwwn, nwwn))
-			return rport;
-	}
-
-	bfa_trc(port->fcs, nwwn);
-	return NULL;
-}
-
-/*
  * PWWN & PID based Lookup for a R-Port in the Port R-Port Queue
  */
 struct bfa_fcs_rport_s *
@@ -5742,54 +5723,6 @@ bfa_fcs_get_base_port(struct bfa_fcs_s *fcs)
 	return &fcs->fabric.bport;
 }
 
-wwn_t
-bfa_fcs_lport_get_rport(struct bfa_fcs_lport_s *port, wwn_t wwn, int index,
-		int nrports, bfa_boolean_t bwwn)
-{
-	struct list_head	*qh, *qe;
-	struct bfa_fcs_rport_s *rport = NULL;
-	int	i;
-	struct bfa_fcs_s	*fcs;
-
-	if (port == NULL || nrports == 0)
-		return (wwn_t) 0;
-
-	fcs = port->fcs;
-	bfa_trc(fcs, (u32) nrports);
-
-	i = 0;
-	qh = &port->rport_q;
-	qe = bfa_q_first(qh);
-
-	while ((qe != qh) && (i < nrports)) {
-		rport = (struct bfa_fcs_rport_s *) qe;
-		if (bfa_ntoh3b(rport->pid) > 0xFFF000) {
-			qe = bfa_q_next(qe);
-			bfa_trc(fcs, (u32) rport->pwwn);
-			bfa_trc(fcs, rport->pid);
-			bfa_trc(fcs, i);
-			continue;
-		}
-
-		if (bwwn) {
-			if (!memcmp(&wwn, &rport->pwwn, 8))
-				break;
-		} else {
-			if (i == index)
-				break;
-		}
-
-		i++;
-		qe = bfa_q_next(qe);
-	}
-
-	bfa_trc(fcs, i);
-	if (rport)
-		return rport->pwwn;
-	else
-		return (wwn_t) 0;
-}
-
 void
 bfa_fcs_lport_get_rport_quals(struct bfa_fcs_lport_s *port,
 		struct bfa_rport_qualifier_s rports[], int *nrports)
@@ -5920,54 +5853,6 @@ bfa_fcs_lookup_port(struct bfa_fcs_s *fcs, u16 vf_id, wwn_t lpwwn)
 	return NULL;
 }
 
-/*
- *  API corresponding to NPIV_VPORT_GETINFO.
- */
-void
-bfa_fcs_lport_get_info(struct bfa_fcs_lport_s *port,
-	 struct bfa_lport_info_s *port_info)
-{
-
-	bfa_trc(port->fcs, port->fabric->fabric_name);
-
-	if (port->vport == NULL) {
-		/*
-		 * This is a Physical port
-		 */
-		port_info->port_type = BFA_LPORT_TYPE_PHYSICAL;
-
-		/*
-		 * @todo : need to fix the state & reason
-		 */
-		port_info->port_state = 0;
-		port_info->offline_reason = 0;
-
-		port_info->port_wwn = bfa_fcs_lport_get_pwwn(port);
-		port_info->node_wwn = bfa_fcs_lport_get_nwwn(port);
-
-		port_info->max_vports_supp =
-			bfa_lps_get_max_vport(port->fcs->bfa);
-		port_info->num_vports_inuse =
-			port->fabric->num_vports;
-		port_info->max_rports_supp = BFA_FCS_MAX_RPORTS_SUPP;
-		port_info->num_rports_inuse = port->num_rports;
-	} else {
-		/*
-		 * This is a virtual port
-		 */
-		port_info->port_type = BFA_LPORT_TYPE_VIRTUAL;
-
-		/*
-		 * @todo : need to fix the state & reason
-		 */
-		port_info->port_state = 0;
-		port_info->offline_reason = 0;
-
-		port_info->port_wwn = bfa_fcs_lport_get_pwwn(port);
-		port_info->node_wwn = bfa_fcs_lport_get_nwwn(port);
-	}
-}
-
 void
 bfa_fcs_lport_get_stats(struct bfa_fcs_lport_s *fcs_port,
 	 struct bfa_lport_stats_s *port_stats)
@@ -6674,15 +6559,6 @@ bfa_fcs_vport_offline(struct bfa_fcs_vport_s *vport)
 }
 
 /*
- * Cleanup notification from fabric SM on link timer expiry.
- */
-void
-bfa_fcs_vport_cleanup(struct bfa_fcs_vport_s *vport)
-{
-	vport->vport_stats.fab_cleanup++;
-}
-
-/*
  * Stop notification from fabric SM. To be invoked from within FCS.
  */
 void
@@ -6805,24 +6681,6 @@ bfa_fcs_pbc_vport_create(struct bfa_fcs_vport_s *vport, struct bfa_fcs_s *fcs,
 }
 
 /*
- *	Use this function to findout if this is a pbc vport or not.
- *
- * @param[in] vport - pointer to bfa_fcs_vport_t.
- *
- * @returns None
- */
-bfa_boolean_t
-bfa_fcs_is_pbc_vport(struct bfa_fcs_vport_s *vport)
-{
-
-	if (vport && (vport->lport.port_cfg.preboot_vp == BFA_TRUE))
-		return BFA_TRUE;
-	else
-		return BFA_FALSE;
-
-}
-
-/*
  * Use this function initialize the vport.
  *
  * @param[in] vport - pointer to bfa_fcs_vport_t.
diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c
index 24e6a126edb0..ec896fa0a219 100644
--- a/drivers/scsi/bfa/bfa_fcs_rport.c
+++ b/drivers/scsi/bfa/bfa_fcs_rport.c
@@ -2646,27 +2646,6 @@ bfa_fcs_rport_create_by_wwn(struct bfa_fcs_lport_s *port, wwn_t rpwwn)
 	bfa_sm_send_event(rport, RPSM_EVENT_ADDRESS_DISC);
 	return rport;
 }
-/*
- * Called by bport in private loop topology to indicate that a
- * rport has been discovered and plogi has been completed.
- *
- * @param[in] port	- base port or vport
- * @param[in] rpid	- remote port ID
- */
-void
-bfa_fcs_rport_start(struct bfa_fcs_lport_s *port, struct fchs_s *fchs,
-	 struct fc_logi_s *plogi)
-{
-	struct bfa_fcs_rport_s *rport;
-
-	rport = bfa_fcs_rport_alloc(port, WWN_NULL, fchs->s_id);
-	if (!rport)
-		return;
-
-	bfa_fcs_rport_update(rport, plogi);
-
-	bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_COMP);
-}
 
 /*
  *	Called by bport/vport to handle PLOGI received from a new remote port.
@@ -3089,21 +3068,6 @@ bfa_fcs_rport_lookup(struct bfa_fcs_lport_s *port, wwn_t rpwwn)
 	return rport;
 }
 
-struct bfa_fcs_rport_s *
-bfa_fcs_rport_lookup_by_nwwn(struct bfa_fcs_lport_s *port, wwn_t rnwwn)
-{
-	struct bfa_fcs_rport_s *rport;
-
-	rport = bfa_fcs_lport_get_rport_by_nwwn(port, rnwwn);
-	if (rport == NULL) {
-		/*
-		 * TBD Error handling
-		 */
-	}
-
-	return rport;
-}
-
 /*
  * Remote port features (RPF) implementation.
  */
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index a503a1a0f44d..992f1e7b42b8 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -2274,33 +2274,12 @@ bfa_ioc_boot(struct bfa_ioc_s *ioc, u32 boot_type, u32 boot_env)
 	return status;
 }
 
-/*
- * Enable/disable IOC failure auto recovery.
- */
-void
-bfa_ioc_auto_recover(bfa_boolean_t auto_recover)
-{
-	bfa_auto_recover = auto_recover;
-}
-
-
-
 bfa_boolean_t
 bfa_ioc_is_operational(struct bfa_ioc_s *ioc)
 {
 	return bfa_fsm_cmp_state(ioc, bfa_ioc_sm_op);
 }
 
-bfa_boolean_t
-bfa_ioc_is_initialized(struct bfa_ioc_s *ioc)
-{
-	u32 r32 = bfa_ioc_get_cur_ioc_fwstate(ioc);
-
-	return ((r32 != BFI_IOC_UNINIT) &&
-		(r32 != BFI_IOC_INITING) &&
-		(r32 != BFI_IOC_MEMTEST));
-}
-
 static bfa_boolean_t
 bfa_ioc_msgget(struct bfa_ioc_s *ioc, void *mbmsg)
 {
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h
index a2df03dc420a..523fb02109b6 100644
--- a/drivers/scsi/bfa/bfa_ioc.h
+++ b/drivers/scsi/bfa/bfa_ioc.h
@@ -869,7 +869,6 @@ void bfa_ioc_ct2_poweron(struct bfa_ioc_s *ioc);
 
 void bfa_ioc_attach(struct bfa_ioc_s *ioc, void *bfa,
 		struct bfa_ioc_cbfn_s *cbfn, struct bfa_timer_mod_s *timer_mod);
-void bfa_ioc_auto_recover(bfa_boolean_t auto_recover);
 void bfa_ioc_detach(struct bfa_ioc_s *ioc);
 void bfa_ioc_suspend(struct bfa_ioc_s *ioc);
 void bfa_ioc_pci_init(struct bfa_ioc_s *ioc, struct bfa_pcidev_s *pcidev,
@@ -881,7 +880,6 @@ bfa_boolean_t bfa_ioc_intx_claim(struct bfa_ioc_s *ioc);
 
 void bfa_ioc_error_isr(struct bfa_ioc_s *ioc);
 bfa_boolean_t bfa_ioc_is_operational(struct bfa_ioc_s *ioc);
-bfa_boolean_t bfa_ioc_is_initialized(struct bfa_ioc_s *ioc);
 bfa_boolean_t bfa_ioc_is_disabled(struct bfa_ioc_s *ioc);
 bfa_boolean_t bfa_ioc_is_acq_addr(struct bfa_ioc_s *ioc);
 bfa_boolean_t bfa_ioc_fw_mismatch(struct bfa_ioc_s *ioc);
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index 9804768c8bba..37d5c2449479 100644
--- a/drivers/scsi/bfa/bfa_svc.c
+++ b/drivers/scsi/bfa/bfa_svc.c
@@ -992,14 +992,6 @@ bfa_fcxp_get_reqbuf(struct bfa_fcxp_s *fcxp)
 	return reqbuf;
 }
 
-u32
-bfa_fcxp_get_reqbufsz(struct bfa_fcxp_s *fcxp)
-{
-	struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod;
-
-	return mod->req_pld_sz;
-}
-
 /*
  * Get the internal response buffer pointer
  *
@@ -1102,21 +1094,6 @@ bfa_fcxp_send(struct bfa_fcxp_s *fcxp, struct bfa_rport_s *rport,
 	bfa_fcxp_queue(fcxp, send_req);
 }
 
-/*
- * Abort a BFA FCXP
- *
- * @param[in]	fcxp	BFA fcxp pointer
- *
- * @return		void
- */
-bfa_status_t
-bfa_fcxp_abort(struct bfa_fcxp_s *fcxp)
-{
-	bfa_trc(fcxp->fcxp_mod->bfa, fcxp->fcxp_tag);
-	WARN_ON(1);
-	return BFA_STATUS_OK;
-}
-
 void
 bfa_fcxp_req_rsp_alloc_wait(struct bfa_s *bfa, struct bfa_fcxp_wqe_s *wqe,
 	       bfa_fcxp_alloc_cbfn_t alloc_cbfn, void *alloc_cbarg,
@@ -3976,15 +3953,6 @@ bfa_fcport_clr_hardalpa(struct bfa_s *bfa)
 	return BFA_STATUS_OK;
 }
 
-bfa_boolean_t
-bfa_fcport_get_hardalpa(struct bfa_s *bfa, u8 *alpa)
-{
-	struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
-
-	*alpa = fcport->cfg.hardalpa;
-	return fcport->cfg.cfg_hardalpa;
-}
-
 u8
 bfa_fcport_get_myalpa(struct bfa_s *bfa)
 {
@@ -4043,16 +4011,6 @@ bfa_fcport_set_tx_bbcredit(struct bfa_s *bfa, u16 tx_bbcredit)
  * Get port attributes.
  */
 
-wwn_t
-bfa_fcport_get_wwn(struct bfa_s *bfa, bfa_boolean_t node)
-{
-	struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
-	if (node)
-		return fcport->nwwn;
-	else
-		return fcport->pwwn;
-}
-
 void
 bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr)
 {
@@ -4225,18 +4183,6 @@ bfa_fcport_is_ratelim(struct bfa_s *bfa)
 }
 
 /*
- *	Enable/Disable FAA feature in port config
- */
-void
-bfa_fcport_cfg_faa(struct bfa_s *bfa, u8 state)
-{
-	struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
-
-	bfa_trc(bfa, state);
-	fcport->cfg.faa_state = state;
-}
-
-/*
  * Get default minimum ratelim speed
  */
 enum bfa_port_speed
diff --git a/drivers/scsi/bfa/bfa_svc.h b/drivers/scsi/bfa/bfa_svc.h
index 69222cc946e4..526292ce7da3 100644
--- a/drivers/scsi/bfa/bfa_svc.h
+++ b/drivers/scsi/bfa/bfa_svc.h
@@ -537,14 +537,12 @@ bfa_status_t bfa_fcport_cfg_topology(struct bfa_s *bfa,
 				     enum bfa_port_topology topo);
 enum bfa_port_topology bfa_fcport_get_topology(struct bfa_s *bfa);
 bfa_status_t bfa_fcport_cfg_hardalpa(struct bfa_s *bfa, u8 alpa);
-bfa_boolean_t bfa_fcport_get_hardalpa(struct bfa_s *bfa, u8 *alpa);
 u8 bfa_fcport_get_myalpa(struct bfa_s *bfa);
 bfa_status_t bfa_fcport_clr_hardalpa(struct bfa_s *bfa);
 bfa_status_t bfa_fcport_cfg_maxfrsize(struct bfa_s *bfa, u16 maxsize);
 u16 bfa_fcport_get_maxfrsize(struct bfa_s *bfa);
 u8 bfa_fcport_get_rx_bbcredit(struct bfa_s *bfa);
 void bfa_fcport_get_attr(struct bfa_s *bfa, struct bfa_port_attr_s *attr);
-wwn_t bfa_fcport_get_wwn(struct bfa_s *bfa, bfa_boolean_t node);
 void bfa_fcport_event_register(struct bfa_s *bfa,
 			void (*event_cbfn) (void *cbarg,
 			enum bfa_port_linkstate event), void *event_cbarg);
@@ -563,7 +561,6 @@ bfa_status_t bfa_fcport_get_stats(struct bfa_s *bfa,
 			struct bfa_cb_pending_q_s *cb);
 bfa_status_t bfa_fcport_clear_stats(struct bfa_s *bfa,
 			struct bfa_cb_pending_q_s *cb);
-void bfa_fcport_cfg_faa(struct bfa_s *bfa, u8 state);
 bfa_status_t bfa_fcport_cfg_bbcr(struct bfa_s *bfa,
 			bfa_boolean_t on_off, u8 bb_scn);
 bfa_status_t bfa_fcport_get_bbcr_attr(struct bfa_s *bfa,
@@ -628,8 +625,6 @@ void bfa_fcxp_send(struct bfa_fcxp_s *fcxp, struct bfa_rport_s *rport,
 		   bfa_cb_fcxp_send_t cbfn,
 		   void *cbarg,
 		   u32 rsp_maxlen, u8 rsp_timeout);
-bfa_status_t bfa_fcxp_abort(struct bfa_fcxp_s *fcxp);
-u32 bfa_fcxp_get_reqbufsz(struct bfa_fcxp_s *fcxp);
 u32 bfa_fcxp_get_maxrsp(struct bfa_s *bfa);
 void bfa_fcxp_res_recfg(struct bfa_s *bfa, u16 num_fcxp_fw);
 
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index 3cb11f6c0b28..c08cd287cfde 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -873,26 +873,6 @@ bfad_drv_init(struct bfad_s *bfad)
 	return BFA_STATUS_OK;
 }
 
-void
-bfad_drv_uninit(struct bfad_s *bfad)
-{
-	unsigned long   flags;
-
-	spin_lock_irqsave(&bfad->bfad_lock, flags);
-	init_completion(&bfad->comp);
-	bfa_iocfc_stop(&bfad->bfa);
-	spin_unlock_irqrestore(&bfad->bfad_lock, flags);
-	wait_for_completion(&bfad->comp);
-
-	del_timer_sync(&bfad->hal_tmo);
-	bfa_isr_disable(&bfad->bfa);
-	bfa_detach(&bfad->bfa);
-	bfad_remove_intr(bfad);
-	bfad_hal_mem_release(bfad);
-
-	bfad->bfad_flags &= ~BFAD_DRV_INIT_DONE;
-}
-
 static void
 bfad_drv_start(struct bfad_s *bfad)
 {
diff --git a/drivers/scsi/bfa/bfad_drv.h b/drivers/scsi/bfa/bfad_drv.h
index 6c5b81708a08..68d72410a131 100644
--- a/drivers/scsi/bfa/bfad_drv.h
+++ b/drivers/scsi/bfa/bfad_drv.h
@@ -301,7 +301,6 @@ bfa_status_t	bfad_vf_create(struct bfad_s *bfad, u16 vf_id,
 			       struct bfa_lport_cfg_s *port_cfg);
 void		bfad_hcb_comp(void *arg, bfa_status_t status);
 
-void		bfad_drv_uninit(struct bfad_s *bfad);
 void		bfad_debugfs_init(struct bfad_port_s *port);
 void		bfad_debugfs_exit(struct bfad_port_s *port);
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/5] bfa: mark symbols static where possible
  2016-08-02 15:22 ` [PATCH 1/5] bfa: mark symbols static where possible Arnd Bergmann
@ 2016-08-03  4:45     ` kbuild test robot
  2016-08-10  5:20   ` Sudarsana Kalluru
  1 sibling, 0 replies; 11+ messages in thread
From: kbuild test robot @ 2016-08-03  4:45 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: kbuild-all, Anil Gurumurthy, Sudarsana Kalluru,
	James E . J . Bottomley, Martin K . Petersen, linux-scsi,
	linux-kernel, Baoyou Xie, Arnd Bergmann

[-- Attachment #1: Type: text/plain, Size: 2401 bytes --]

Hi Arnd,

[auto build test ERROR on scsi/for-next]
[also build test ERROR on v4.7 next-20160802]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Arnd-Bergmann/bfa-fix-W-1-build-warnings/20160803-122019
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

Note: the linux-review/Arnd-Bergmann/bfa-fix-W-1-build-warnings/20160803-122019 HEAD 6b97e29875c21d79abdc2be27ed0d7edb05dff6a builds fine.
      It only hurts bisectibility.

All errors (new ones prefixed by >>):

   drivers/scsi/bfa/bfad.c: In function 'bfad_drv_uninit':
>> drivers/scsi/bfa/bfad.c:888:2: error: implicit declaration of function 'bfa_isr_disable' [-Werror=implicit-function-declaration]
     bfa_isr_disable(&bfad->bfa);
     ^
   cc1: some warnings being treated as errors

vim +/bfa_isr_disable +888 drivers/scsi/bfa/bfad.c

a36c61f90 Krishna Gudipati 2010-09-15  882  	init_completion(&bfad->comp);
f7f73812e Maggie Zhang     2010-12-09  883  	bfa_iocfc_stop(&bfad->bfa);
a36c61f90 Krishna Gudipati 2010-09-15  884  	spin_unlock_irqrestore(&bfad->bfad_lock, flags);
e67143243 Krishna Gudipati 2010-03-03  885  	wait_for_completion(&bfad->comp);
e67143243 Krishna Gudipati 2010-03-03  886  
7725ccfda Jing Huang       2009-09-23  887  	del_timer_sync(&bfad->hal_tmo);
7725ccfda Jing Huang       2009-09-23 @888  	bfa_isr_disable(&bfad->bfa);
7725ccfda Jing Huang       2009-09-23  889  	bfa_detach(&bfad->bfa);
7725ccfda Jing Huang       2009-09-23  890  	bfad_remove_intr(bfad);
7725ccfda Jing Huang       2009-09-23  891  	bfad_hal_mem_release(bfad);

:::::: The code at line 888 was first introduced by commit
:::::: 7725ccfda59715ecf8f99e3b520a0b84cc2ea79e [SCSI] bfa: Brocade BFA FC SCSI driver

:::::: TO: Jing Huang <huangj@brocade.com>
:::::: CC: James Bottomley <James.Bottomley@suse.de>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 45357 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/5] bfa: mark symbols static where possible
@ 2016-08-03  4:45     ` kbuild test robot
  0 siblings, 0 replies; 11+ messages in thread
From: kbuild test robot @ 2016-08-03  4:45 UTC (permalink / raw)
  Cc: kbuild-all, Anil Gurumurthy, Sudarsana Kalluru,
	James E . J . Bottomley, Martin K . Petersen, linux-scsi,
	linux-kernel, Baoyou Xie, Arnd Bergmann

[-- Attachment #1: Type: text/plain, Size: 2401 bytes --]

Hi Arnd,

[auto build test ERROR on scsi/for-next]
[also build test ERROR on v4.7 next-20160802]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Arnd-Bergmann/bfa-fix-W-1-build-warnings/20160803-122019
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

Note: the linux-review/Arnd-Bergmann/bfa-fix-W-1-build-warnings/20160803-122019 HEAD 6b97e29875c21d79abdc2be27ed0d7edb05dff6a builds fine.
      It only hurts bisectibility.

All errors (new ones prefixed by >>):

   drivers/scsi/bfa/bfad.c: In function 'bfad_drv_uninit':
>> drivers/scsi/bfa/bfad.c:888:2: error: implicit declaration of function 'bfa_isr_disable' [-Werror=implicit-function-declaration]
     bfa_isr_disable(&bfad->bfa);
     ^
   cc1: some warnings being treated as errors

vim +/bfa_isr_disable +888 drivers/scsi/bfa/bfad.c

a36c61f90 Krishna Gudipati 2010-09-15  882  	init_completion(&bfad->comp);
f7f73812e Maggie Zhang     2010-12-09  883  	bfa_iocfc_stop(&bfad->bfa);
a36c61f90 Krishna Gudipati 2010-09-15  884  	spin_unlock_irqrestore(&bfad->bfad_lock, flags);
e67143243 Krishna Gudipati 2010-03-03  885  	wait_for_completion(&bfad->comp);
e67143243 Krishna Gudipati 2010-03-03  886  
7725ccfda Jing Huang       2009-09-23  887  	del_timer_sync(&bfad->hal_tmo);
7725ccfda Jing Huang       2009-09-23 @888  	bfa_isr_disable(&bfad->bfa);
7725ccfda Jing Huang       2009-09-23  889  	bfa_detach(&bfad->bfa);
7725ccfda Jing Huang       2009-09-23  890  	bfad_remove_intr(bfad);
7725ccfda Jing Huang       2009-09-23  891  	bfad_hal_mem_release(bfad);

:::::: The code at line 888 was first introduced by commit
:::::: 7725ccfda59715ecf8f99e3b520a0b84cc2ea79e [SCSI] bfa: Brocade BFA FC SCSI driver

:::::: TO: Jing Huang <huangj@brocade.com>
:::::: CC: James Bottomley <James.Bottomley@suse.de>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 45357 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/5] bfa: mark symbols static where possible
  2016-08-03  4:45     ` kbuild test robot
  (?)
@ 2016-08-03  7:46     ` Arnd Bergmann
  -1 siblings, 0 replies; 11+ messages in thread
From: Arnd Bergmann @ 2016-08-03  7:46 UTC (permalink / raw)
  To: kbuild test robot
  Cc: kbuild-all, Anil Gurumurthy, Sudarsana Kalluru,
	James E . J . Bottomley, Martin K . Petersen, linux-scsi,
	linux-kernel, Baoyou Xie

On Wednesday, August 3, 2016 12:45:50 PM CEST kbuild test robot wrote:
> All errors (new ones prefixed by >>):
> 
>    drivers/scsi/bfa/bfad.c: In function 'bfad_drv_uninit':
> >> drivers/scsi/bfa/bfad.c:888:2: error: implicit declaration of function 'bfa_isr_disable' [-Werror=implicit-function-declaration]
>      bfa_isr_disable(&bfad->bfa);
>      ^
>    cc1: some warnings being treated as errors
> 

Ah right: This is called in a function that gets removed in patch 5,
after which it is actually local. I made a mistake here when I went
through a repeated search for local functions.

I'll wait for other comments first before I send a fixed version.

	Arnd

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH 1/5] bfa: mark symbols static where possible
  2016-08-02 15:22 ` [PATCH 1/5] bfa: mark symbols static where possible Arnd Bergmann
  2016-08-03  4:45     ` kbuild test robot
@ 2016-08-10  5:20   ` Sudarsana Kalluru
  1 sibling, 0 replies; 11+ messages in thread
From: Sudarsana Kalluru @ 2016-08-10  5:20 UTC (permalink / raw)
  To: Arnd Bergmann, Anil Gurumurthy
  Cc: James E . J . Bottomley, Martin K . Petersen, linux-scsi,
	linux-kernel, Baoyou Xie

Hi,
   Thanks for the change. Following declarations also look to be referenced in a single file and can be removed. Please check.
drivers/scsi/bfa/bfad_im.h:
	extern struct scsi_host_template bfad_im_scsi_host_template;
	extern struct scsi_transport_template *bfad_im_scsi_transport_template;
	extern struct scsi_transport_template *bfad_im_scsi_vport_transport_template;

Thanks,
Sudarsana

-----Original Message-----
From: Arnd Bergmann [mailto:arnd@arndb.de] 
Sent: 02 August 2016 20:53
To: Anil Gurumurthy <Anil.Gurumurthy@qlogic.com>; Sudarsana Kalluru <Sudarsana.Kalluru@qlogic.com>
Cc: James E . J . Bottomley <jejb@linux.vnet.ibm.com>; Martin K . Petersen <martin.petersen@oracle.com>; linux-scsi <linux-scsi@vger.kernel.org>; linux-kernel <linux-kernel@vger.kernel.org>; Baoyou Xie <baoyou.xie@linaro.org>; Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 1/5] bfa: mark symbols static where possible

We get 128 warnings about global functions without a declaration
in the bfa scsi driver when building with W=1, more than any other
driver, e.g.

bfa/bfad.c:1502:1: error: no previous prototype for 'restart_bfa'
bfa/bfad_attr.c:447:1: error: no previous prototype for 'bfad_im_issue_fc_host_lip'
bfa/bfad_attr.c:575:1: error: no previous prototype for 'bfad_im_vport_set_symbolic_name'
bfa/bfad_bsg.c:27:1: error: no previous prototype for 'bfad_iocmd_ioc_enable'
bfa/bfad_bsg.c:50:1: error: no previous prototype for 'bfad_iocmd_ioc_disable'
bfa/bfad_bsg.c:148:1: error: no previous prototype for 'bfad_iocmd_ioc_get_stats'

In this case, all of those functions are only used in the file in
which they are declared and don't need a declaration, but can be
made static. A little more research reveals many more functions
in this driver that have a declaration but are also used only
in the same file, so this patch marks them all 'static' and moves
the declarations from a header file into the .c file where necessary.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/bfa/bfa.h           |  15 ---
 drivers/scsi/bfa/bfa_core.c      |  19 ++--
 drivers/scsi/bfa/bfa_fcbuild.c   |   2 +-
 drivers/scsi/bfa/bfa_fcbuild.h   |   3 -
 drivers/scsi/bfa/bfa_fcpim.c     |  66 ++++++++----
 drivers/scsi/bfa/bfa_fcpim.h     |  25 -----
 drivers/scsi/bfa/bfa_fcs.c       |  31 ++++--
 drivers/scsi/bfa/bfa_fcs.h       |  41 -------
 drivers/scsi/bfa/bfa_fcs_lport.c |  69 ++++++++----
 drivers/scsi/bfa/bfa_fcs_rport.c |   9 +-
 drivers/scsi/bfa/bfa_ioc.c       |  44 ++++----
 drivers/scsi/bfa/bfa_ioc.h       |  23 ----
 drivers/scsi/bfa/bfa_ioc_cb.c    |   3 +-
 drivers/scsi/bfa/bfa_ioc_ct.c    |  12 ++-
 drivers/scsi/bfa/bfa_plog.h      |   8 --
 drivers/scsi/bfa/bfa_port.c      |   6 +-
 drivers/scsi/bfa/bfa_port.h      |   1 -
 drivers/scsi/bfa/bfa_svc.c       |  38 ++++---
 drivers/scsi/bfa/bfa_svc.h       |  12 ---
 drivers/scsi/bfa/bfad.c          |  88 ++++++++-------
 drivers/scsi/bfa/bfad_attr.c     |   4 +-
 drivers/scsi/bfa/bfad_bsg.c      | 224 +++++++++++++++++++--------------------
 drivers/scsi/bfa/bfad_drv.h      |  44 +-------
 drivers/scsi/bfa/bfad_im.c       |  23 ++--
 drivers/scsi/bfa/bfad_im.h       |  10 --
 25 files changed, 372 insertions(+), 448 deletions(-)

diff --git a/drivers/scsi/bfa/bfa.h b/drivers/scsi/bfa/bfa.h
index 0e119d838e1b..c3b499d126d5 100644
--- a/drivers/scsi/bfa/bfa.h
+++ b/drivers/scsi/bfa/bfa.h
@@ -31,11 +31,6 @@ typedef void (*bfa_isr_func_t) (struct bfa_s *bfa, struct bfi_msg_s *m);
 typedef void (*bfa_cb_cbfn_status_t) (void *cbarg, bfa_status_t status);
 
 /*
- * Interrupt message handlers
- */
-void bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m);
-
-/*
  * Request and response queue related defines
  */
 #define BFA_REQQ_NELEMS_MIN	(4)
@@ -299,19 +294,11 @@ struct bfa_iocfc_s {
 /*
  * FC specific IOC functions.
  */
-void bfa_iocfc_meminfo(struct bfa_iocfc_cfg_s *cfg,
-			struct bfa_meminfo_s *meminfo,
-			struct bfa_s *bfa);
-void bfa_iocfc_attach(struct bfa_s *bfa, void *bfad,
-		      struct bfa_iocfc_cfg_s *cfg,
-		      struct bfa_pcidev_s *pcidev);
 void bfa_iocfc_init(struct bfa_s *bfa);
 void bfa_iocfc_start(struct bfa_s *bfa);
 void bfa_iocfc_stop(struct bfa_s *bfa);
-void bfa_iocfc_isr(void *bfa, struct bfi_mbmsg_s *msg);
 void bfa_iocfc_set_snsbase(struct bfa_s *bfa, int seg_no, u64 snsbase_pa);
 bfa_boolean_t bfa_iocfc_is_operational(struct bfa_s *bfa);
-void bfa_iocfc_reset_queues(struct bfa_s *bfa);
 
 void bfa_msix_all(struct bfa_s *bfa, int vec);
 void bfa_msix_reqq(struct bfa_s *bfa, int vec);
@@ -413,8 +400,6 @@ void bfa_cb_init(void *bfad, bfa_status_t status);
 void bfa_cb_updateq(void *bfad, bfa_status_t status);
 
 bfa_boolean_t bfa_intx(struct bfa_s *bfa);
-void bfa_isr_enable(struct bfa_s *bfa);
-void bfa_isr_disable(struct bfa_s *bfa);
 
 void bfa_comp_deq(struct bfa_s *bfa, struct list_head *comp_q);
 void bfa_comp_process(struct bfa_s *bfa, struct list_head *comp_q);
diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c
index 7209afad82f7..75c6db27a399 100644
--- a/drivers/scsi/bfa/bfa_core.c
+++ b/drivers/scsi/bfa/bfa_core.c
@@ -22,6 +22,11 @@
 
 BFA_TRC_FILE(HAL, CORE);
 
+static void bfa_iocfc_reset_queues(struct bfa_s *bfa);
+static void bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m);
+static void bfa_iocfc_isr(void *bfaarg, struct bfi_mbmsg_s *m);
+static void bfa_isr_disable(struct bfa_s *bfa);
+
 /*
  * BFA module list terminated by NULL
  */
@@ -732,7 +737,7 @@ bfa_reqq_resume(struct bfa_s *bfa, int qid)
 	}
 }
 
-bfa_boolean_t
+static bfa_boolean_t
 bfa_isr_rspq(struct bfa_s *bfa, int qid)
 {
 	struct bfi_msg_s *m;
@@ -864,7 +869,7 @@ bfa_intx(struct bfa_s *bfa)
 	return BFA_TRUE;
 }
 
-void
+static void
 bfa_isr_enable(struct bfa_s *bfa)
 {
 	u32 umsk;
@@ -910,7 +915,7 @@ bfa_msix_reqq(struct bfa_s *bfa, int vec)
 	bfa_isr_reqq(bfa, vec - bfa->iocfc.hwif.cpe_vec_q0);
 }
 
-void
+static void
 bfa_isr_unhandled(struct bfa_s *bfa, struct bfi_msg_s *m)
 {
 	bfa_trc(bfa, m->mhdr.msg_class);
@@ -1328,7 +1333,7 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa)
 	}
 }
 
-void
+static void
 bfa_iocfc_reset_queues(struct bfa_s *bfa)
 {
 	int		q;
@@ -1483,7 +1488,7 @@ bfa_iocfc_reset_cbfn(void *bfa_arg)
 /*
  * Query IOC memory requirement information.
  */
-void
+static void
 bfa_iocfc_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo,
 		  struct bfa_s *bfa)
 {
@@ -1529,7 +1534,7 @@ bfa_iocfc_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo,
 /*
  * Query IOC memory requirement information.
  */
-void
+static void
 bfa_iocfc_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
 		 struct bfa_pcidev_s *pcidev)
 {
@@ -1591,7 +1596,7 @@ bfa_iocfc_stop(struct bfa_s *bfa)
 	bfa_fsm_send_event(&bfa->iocfc, IOCFC_E_STOP);
 }
 
-void
+static void
 bfa_iocfc_isr(void *bfaarg, struct bfi_mbmsg_s *m)
 {
 	struct bfa_s		*bfa = bfaarg;
diff --git a/drivers/scsi/bfa/bfa_fcbuild.c b/drivers/scsi/bfa/bfa_fcbuild.c
index b8dadc9cc993..baf22632ee96 100644
--- a/drivers/scsi/bfa/bfa_fcbuild.c
+++ b/drivers/scsi/bfa/bfa_fcbuild.c
@@ -172,7 +172,7 @@ fc_gsresp_fchdr_build(struct fchs_s *fchs, u32 d_id, u32 s_id, u16 ox_id)
 	fchs->ox_id = ox_id;
 }
 
-void
+static void
 fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id, __be16 ox_id)
 {
 	memcpy(fchs, &fc_els_req_tmpl, sizeof(struct fchs_s));
diff --git a/drivers/scsi/bfa/bfa_fcbuild.h b/drivers/scsi/bfa/bfa_fcbuild.h
index b109a8813401..433316fa72fa 100644
--- a/drivers/scsi/bfa/bfa_fcbuild.h
+++ b/drivers/scsi/bfa/bfa_fcbuild.h
@@ -273,9 +273,6 @@ u16	fc_gfn_req_build(struct fchs_s *fchs, void *pyld, u32 s_id, wwn_t wwn);
 
 void		fc_get_fc4type_bitmask(u8 fc4_type, u8 *bit_mask);
 
-void		fc_els_req_build(struct fchs_s *fchs, u32 d_id, u32 s_id,
-					 __be16 ox_id);
-
 enum fc_parse_status	fc_els_rsp_parse(struct fchs_s *fchs, int len);
 
 enum fc_parse_status	fc_plogi_rsp_parse(struct fchs_s *fchs, int len,
diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c
index 20982e7cdd81..2132ab2ca88e 100644
--- a/drivers/scsi/bfa/bfa_fcpim.c
+++ b/drivers/scsi/bfa/bfa_fcpim.c
@@ -179,6 +179,8 @@ static void     bfa_itnim_iotov(void *itnim_arg);
 static void     bfa_itnim_iotov_start(struct bfa_itnim_s *itnim);
 static void     bfa_itnim_iotov_stop(struct bfa_itnim_s *itnim);
 static void     bfa_itnim_iotov_delete(struct bfa_itnim_s *itnim);
+static bfa_boolean_t bfa_itnim_hold_io(struct bfa_itnim_s *itnim);
+
 
 /*
  * forward declaration of ITNIM state machine
@@ -213,6 +215,9 @@ static void     bfa_itnim_sm_fwdelete_qfull(struct bfa_itnim_s *itnim,
 					enum bfa_itnim_event event);
 static void     bfa_itnim_sm_deleting_qfull(struct bfa_itnim_s *itnim,
 					enum bfa_itnim_event event);
+static void	bfa_itnim_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len);
+static void	bfa_itnim_iocdisable(struct bfa_itnim_s *itnim);
+static void	bfa_itnim_attach(struct bfa_fcpim_s *fcpim);
 
 /*
  * forward declaration for BFA IOIM functions
@@ -227,6 +232,13 @@ static void __bfa_cb_ioim_abort(void *cbarg, bfa_boolean_t complete);
 static void __bfa_cb_ioim_failed(void *cbarg, bfa_boolean_t complete);
 static void __bfa_cb_ioim_pathtov(void *cbarg, bfa_boolean_t complete);
 static bfa_boolean_t    bfa_ioim_is_abortable(struct bfa_ioim_s *ioim);
+static void	bfa_ioim_attach(struct bfa_fcpim_s *fcpim);
+static void	bfa_ioim_tov(struct bfa_ioim_s *ioim);
+static void	bfa_ioim_cleanup(struct bfa_ioim_s *ioim);
+static void	bfa_ioim_iocdisable(struct bfa_ioim_s *ioim);
+static void	bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim,
+				      bfa_boolean_t iotov);
+static void	bfa_ioim_free(struct bfa_ioim_s *ioim);
 
 /*
  * forward declaration of BFA IO state machine
@@ -268,6 +280,9 @@ static void     bfa_tskim_cleanup_ios(struct bfa_tskim_s *tskim);
 static bfa_boolean_t bfa_tskim_send(struct bfa_tskim_s *tskim);
 static bfa_boolean_t bfa_tskim_send_abort(struct bfa_tskim_s *tskim);
 static void     bfa_tskim_iocdisable_ios(struct bfa_tskim_s *tskim);
+static void	bfa_tskim_attach(struct bfa_fcpim_s *fcpim);
+static void	bfa_tskim_iocdisable(struct bfa_tskim_s *tskim);
+static void	bfa_tskim_cleanup(struct bfa_tskim_s *tskim);
 
 /*
  * forward declaration of BFA TSKIM state machine
@@ -286,6 +301,11 @@ static void     bfa_tskim_sm_cleanup_qfull(struct bfa_tskim_s *tskim,
 					enum bfa_tskim_event event);
 static void     bfa_tskim_sm_hcb(struct bfa_tskim_s *tskim,
 					enum bfa_tskim_event event);
+
+static void bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport,
+		void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m));
+static void bfa_iotag_attach(struct bfa_fcp_mod_s *fcp);
+static u16 bfa_fcpim_read_throttle(struct bfa_s *bfa);
 /*
  *  BFA FCP Initiator Mode module
  */
@@ -445,7 +465,7 @@ bfa_fcpim_port_iostats(struct bfa_s *bfa,
 	return BFA_STATUS_OK;
 }
 
-void
+static void
 bfa_ioim_profile_comp(struct bfa_ioim_s *ioim)
 {
 	struct bfa_itnim_latency_s *io_lat =
@@ -462,7 +482,7 @@ bfa_ioim_profile_comp(struct bfa_ioim_s *ioim)
 	io_lat->avg[idx] += val;
 }
 
-void
+static void
 bfa_ioim_profile_start(struct bfa_ioim_s *ioim)
 {
 	ioim->start_time = jiffies;
@@ -1090,19 +1110,19 @@ bfa_itnim_qresume(void *cbarg)
  *  bfa_itnim_public
  */
 
-void
+static void
 bfa_itnim_iodone(struct bfa_itnim_s *itnim)
 {
 	bfa_wc_down(&itnim->wc);
 }
 
-void
+static void
 bfa_itnim_tskdone(struct bfa_itnim_s *itnim)
 {
 	bfa_wc_down(&itnim->wc);
 }
 
-void
+static void
 bfa_itnim_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len)
 {
 	/*
@@ -1111,7 +1131,7 @@ bfa_itnim_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len)
 	*km_len += cfg->fwcfg.num_rports * sizeof(struct bfa_itnim_s);
 }
 
-void
+static void
 bfa_itnim_attach(struct bfa_fcpim_s *fcpim)
 {
 	struct bfa_s	*bfa = fcpim->bfa;
@@ -1146,7 +1166,7 @@ bfa_itnim_attach(struct bfa_fcpim_s *fcpim)
 	bfa_mem_kva_curp(fcp) = (u8 *) itnim;
 }
 
-void
+static void
 bfa_itnim_iocdisable(struct bfa_itnim_s *itnim)
 {
 	bfa_stats(itnim, ioc_disabled);
@@ -1360,7 +1380,7 @@ bfa_itnim_update_del_itn_stats(struct bfa_itnim_s *itnim)
 /*
  * Itnim interrupt processing.
  */
-void
+static void
 bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
 {
 	struct bfa_fcpim_s *fcpim = BFA_FCPIM(bfa);
@@ -1450,7 +1470,7 @@ bfa_itnim_offline(struct bfa_itnim_s *itnim)
  * Return true if itnim is considered offline for holding off IO request.
  * IO is not held if itnim is being deleted.
  */
-bfa_boolean_t
+static bfa_boolean_t
 bfa_itnim_hold_io(struct bfa_itnim_s *itnim)
 {
 	return itnim->fcpim->path_tov && itnim->iotov_active &&
@@ -2714,7 +2734,7 @@ bfa_ioim_is_abortable(struct bfa_ioim_s *ioim)
 	return BFA_TRUE;
 }
 
-void
+static void
 bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim, bfa_boolean_t iotov)
 {
 	/*
@@ -2744,7 +2764,7 @@ bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim, bfa_boolean_t iotov)
 /*
  * Memory allocation and initialization.
  */
-void
+static void
 bfa_ioim_attach(struct bfa_fcpim_s *fcpim)
 {
 	struct bfa_ioim_s		*ioim;
@@ -2893,7 +2913,7 @@ bfa_ioim_good_comp_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
 /*
  * Called by itnim to clean up IO while going offline.
  */
-void
+static void
 bfa_ioim_cleanup(struct bfa_ioim_s *ioim)
 {
 	bfa_trc(ioim->bfa, ioim->iotag);
@@ -2903,7 +2923,7 @@ bfa_ioim_cleanup(struct bfa_ioim_s *ioim)
 	bfa_sm_send_event(ioim, BFA_IOIM_SM_CLEANUP);
 }
 
-void
+static void
 bfa_ioim_cleanup_tm(struct bfa_ioim_s *ioim, struct bfa_tskim_s *tskim)
 {
 	bfa_trc(ioim->bfa, ioim->iotag);
@@ -2916,7 +2936,7 @@ bfa_ioim_cleanup_tm(struct bfa_ioim_s *ioim, struct bfa_tskim_s *tskim)
 /*
  * IOC failure handling.
  */
-void
+static void
 bfa_ioim_iocdisable(struct bfa_ioim_s *ioim)
 {
 	bfa_trc(ioim->bfa, ioim->iotag);
@@ -2927,7 +2947,7 @@ bfa_ioim_iocdisable(struct bfa_ioim_s *ioim)
 /*
  * IO offline TOV popped. Fail the pending IO.
  */
-void
+static void
 bfa_ioim_tov(struct bfa_ioim_s *ioim)
 {
 	bfa_trc(ioim->bfa, ioim->iotag);
@@ -2970,7 +2990,7 @@ bfa_ioim_alloc(struct bfa_s *bfa, struct bfad_ioim_s *dio,
 	return ioim;
 }
 
-void
+static void
 bfa_ioim_free(struct bfa_ioim_s *ioim)
 {
 	struct bfa_fcpim_s *fcpim = ioim->fcpim;
@@ -3489,7 +3509,7 @@ bfa_tskim_iodone(struct bfa_tskim_s *tskim)
 /*
  * Handle IOC h/w failure notification from itnim.
  */
-void
+static void
 bfa_tskim_iocdisable(struct bfa_tskim_s *tskim)
 {
 	tskim->notify = BFA_FALSE;
@@ -3500,7 +3520,7 @@ bfa_tskim_iocdisable(struct bfa_tskim_s *tskim)
 /*
  * Cleanup TM command and associated IOs as part of ITNIM offline.
  */
-void
+static void
 bfa_tskim_cleanup(struct bfa_tskim_s *tskim)
 {
 	tskim->notify = BFA_TRUE;
@@ -3511,7 +3531,7 @@ bfa_tskim_cleanup(struct bfa_tskim_s *tskim)
 /*
  * Memory allocation and initialization.
  */
-void
+static void
 bfa_tskim_attach(struct bfa_fcpim_s *fcpim)
 {
 	struct bfa_tskim_s *tskim;
@@ -3795,7 +3815,7 @@ bfa_fcp_res_recfg(struct bfa_s *bfa, u16 num_ioim_fw, u16 max_ioim_fw)
 	mod->throttle_update_required = 0;
 }
 
-void
+static void
 bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport,
 		void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m))
 {
@@ -3825,7 +3845,7 @@ bfa_itn_isr(struct bfa_s *bfa, struct bfi_msg_s *m)
 		WARN_ON(1);
 }
 
-void
+static void
 bfa_iotag_attach(struct bfa_fcp_mod_s *fcp)
 {
 	struct bfa_iotag_s *iotag;
@@ -3879,7 +3899,7 @@ bfa_fcpim_get_throttle_cfg(struct bfa_s *bfa, u16 drv_cfg_param)
 	return tmp;
 }
 
-bfa_status_t
+static bfa_status_t
 bfa_fcpim_write_throttle(struct bfa_s *bfa, u16 value)
 {
 	if (!bfa_dconf_get_min_cfg(bfa)) {
@@ -3891,7 +3911,7 @@ bfa_fcpim_write_throttle(struct bfa_s *bfa, u16 value)
 	return BFA_STATUS_FAILED;
 }
 
-u16
+static u16
 bfa_fcpim_read_throttle(struct bfa_s *bfa)
 {
 	struct bfa_throttle_cfg_s *throttle_cfg =
diff --git a/drivers/scsi/bfa/bfa_fcpim.h b/drivers/scsi/bfa/bfa_fcpim.h
index e93921dec347..c3dfd26350c2 100644
--- a/drivers/scsi/bfa/bfa_fcpim.h
+++ b/drivers/scsi/bfa/bfa_fcpim.h
@@ -39,10 +39,7 @@ struct bfa_itn_s {
 	bfa_isr_func_t isr;
 };
 
-void bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport,
-		void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m));
 void bfa_itn_isr(struct bfa_s *bfa, struct bfi_msg_s *m);
-void bfa_iotag_attach(struct bfa_fcp_mod_s *fcp);
 void bfa_fcp_res_recfg(struct bfa_s *bfa, u16 num_ioim_fw, u16 max_ioim_fw);
 
 #define BFA_FCP_MOD(_hal)	(&(_hal)->modules.fcp_mod)
@@ -275,31 +272,14 @@ bfa_ioim_maxretry_reached(struct bfa_ioim_s *ioim)
 /*
  * function prototypes
  */
-void	bfa_ioim_attach(struct bfa_fcpim_s *fcpim);
 void	bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
 void	bfa_ioim_good_comp_isr(struct bfa_s *bfa,
 					struct bfi_msg_s *msg);
-void	bfa_ioim_cleanup(struct bfa_ioim_s *ioim);
-void	bfa_ioim_cleanup_tm(struct bfa_ioim_s *ioim,
-					struct bfa_tskim_s *tskim);
-void	bfa_ioim_iocdisable(struct bfa_ioim_s *ioim);
-void	bfa_ioim_tov(struct bfa_ioim_s *ioim);
 
-void	bfa_tskim_attach(struct bfa_fcpim_s *fcpim);
 void	bfa_tskim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
 void	bfa_tskim_iodone(struct bfa_tskim_s *tskim);
-void	bfa_tskim_iocdisable(struct bfa_tskim_s *tskim);
-void	bfa_tskim_cleanup(struct bfa_tskim_s *tskim);
 void	bfa_tskim_res_recfg(struct bfa_s *bfa, u16 num_tskim_fw);
 
-void	bfa_itnim_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len);
-void	bfa_itnim_attach(struct bfa_fcpim_s *fcpim);
-void	bfa_itnim_iocdisable(struct bfa_itnim_s *itnim);
-void	bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
-void	bfa_itnim_iodone(struct bfa_itnim_s *itnim);
-void	bfa_itnim_tskdone(struct bfa_itnim_s *itnim);
-bfa_boolean_t   bfa_itnim_hold_io(struct bfa_itnim_s *itnim);
-
 /*
  * bfa fcpim module API functions
  */
@@ -368,11 +348,8 @@ struct bfa_ioim_s	*bfa_ioim_alloc(struct bfa_s *bfa,
 					struct bfa_itnim_s *itnim,
 					u16 nsgles);
 
-void		bfa_ioim_free(struct bfa_ioim_s *ioim);
 void		bfa_ioim_start(struct bfa_ioim_s *ioim);
 bfa_status_t	bfa_ioim_abort(struct bfa_ioim_s *ioim);
-void		bfa_ioim_delayed_comp(struct bfa_ioim_s *ioim,
-				      bfa_boolean_t iotov);
 /*
  * I/O completion notification.
  *
@@ -421,8 +398,6 @@ bfa_status_t	bfa_fcpim_lunmask_delete(struct bfa_s *bfa, u16 vf_id,
 bfa_status_t	bfa_fcpim_lunmask_add(struct bfa_s *bfa, u16 vf_id,
 				wwn_t *pwwn, wwn_t rpwwn, struct scsi_lun lun);
 bfa_status_t	bfa_fcpim_lunmask_clear(struct bfa_s *bfa);
-u16		bfa_fcpim_read_throttle(struct bfa_s *bfa);
-bfa_status_t	bfa_fcpim_write_throttle(struct bfa_s *bfa, u16 value);
 bfa_status_t	bfa_fcpim_throttle_set(struct bfa_s *bfa, u16 value);
 bfa_status_t	bfa_fcpim_throttle_get(struct bfa_s *bfa, void *buf);
 u16     bfa_fcpim_get_throttle_cfg(struct bfa_s *bfa, u16 drv_cfg_param);
diff --git a/drivers/scsi/bfa/bfa_fcs.c b/drivers/scsi/bfa/bfa_fcs.c
index 1e7e139d71ea..7d50a610d6f8 100644
--- a/drivers/scsi/bfa/bfa_fcs.c
+++ b/drivers/scsi/bfa/bfa_fcs.c
@@ -38,6 +38,15 @@ struct bfa_fcs_mod_s {
 
 #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
 
+static void bfa_fcs_port_attach(struct bfa_fcs_s *fcs);
+static void bfa_fcs_uf_attach(struct bfa_fcs_s *fcs);
+static void bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs);
+static void bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs);
+static void bfa_fcs_fabric_modexit(struct bfa_fcs_s *fcs);
+static void bfa_fcs_fabric_modstop(struct bfa_fcs_s *fcs);
+static void bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric);
+static void bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric);
+
 static struct bfa_fcs_mod_s fcs_modules[] = {
 	{ bfa_fcs_port_attach, NULL, NULL },
 	{ bfa_fcs_uf_attach, NULL, NULL },
@@ -822,7 +831,7 @@ bfa_fcs_fabric_init(struct bfa_fcs_fabric_s *fabric)
 /*
  * Port Symbolic Name Creation for base port.
  */
-void
+static void
 bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric)
 {
 	struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg;
@@ -883,7 +892,7 @@ bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric)
 /*
  * Node Symbolic Name Creation for base port and all vports
  */
-void
+static void
 bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric)
 {
 	struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg;
@@ -1130,7 +1139,7 @@ bfa_fcs_fabric_stop_comp(void *cbarg)
 /*
  * Attach time initialization.
  */
-void
+static void
 bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs)
 {
 	struct bfa_fcs_fabric_s *fabric;
@@ -1158,7 +1167,7 @@ bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs)
 	bfa_fcs_lport_attach(&fabric->bport, fabric->fcs, FC_VF_ID_NULL, NULL);
 }
 
-void
+static void
 bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs)
 {
 	bfa_sm_send_event(&fcs->fabric, BFA_FCS_FABRIC_SM_CREATE);
@@ -1168,7 +1177,7 @@ bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs)
 /*
  *   Module cleanup
  */
-void
+static void
 bfa_fcs_fabric_modexit(struct bfa_fcs_s *fcs)
 {
 	struct bfa_fcs_fabric_s *fabric;
@@ -1186,7 +1195,7 @@ bfa_fcs_fabric_modexit(struct bfa_fcs_s *fcs)
 /*
  * Fabric module stop -- stop FCS actions
  */
-void
+static void
 bfa_fcs_fabric_modstop(struct bfa_fcs_s *fcs)
 {
 	struct bfa_fcs_fabric_s *fabric;
@@ -1213,7 +1222,7 @@ bfa_fcs_fabric_modstart(struct bfa_fcs_s *fcs)
 /*
  *   Link up notification from BFA physical port module.
  */
-void
+static void
 bfa_fcs_fabric_link_up(struct bfa_fcs_fabric_s *fabric)
 {
 	bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
@@ -1223,7 +1232,7 @@ bfa_fcs_fabric_link_up(struct bfa_fcs_fabric_s *fabric)
 /*
  *   Link down notification from BFA physical port module.
  */
-void
+static void
 bfa_fcs_fabric_link_down(struct bfa_fcs_fabric_s *fabric)
 {
 	bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
@@ -1317,7 +1326,7 @@ bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric)
 /*
  *		Unsolicited frame receive handling.
  */
-void
+static void
 bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs,
 		       u16 len)
 {
@@ -1633,7 +1642,7 @@ bfa_fcs_port_event_handler(void *cbarg, enum bfa_port_linkstate event)
 	}
 }
 
-void
+static void
 bfa_fcs_port_attach(struct bfa_fcs_s *fcs)
 {
 	bfa_fcport_event_register(fcs->bfa, bfa_fcs_port_event_handler, fcs);
@@ -1706,7 +1715,7 @@ bfa_fcs_uf_recv(void *cbarg, struct bfa_uf_s *uf)
 	bfa_uf_free(uf);
 }
 
-void
+static void
 bfa_fcs_uf_attach(struct bfa_fcs_s *fcs)
 {
 	bfa_uf_recv_register(fcs->bfa, bfa_fcs_uf_recv, fcs);
diff --git a/drivers/scsi/bfa/bfa_fcs.h b/drivers/scsi/bfa/bfa_fcs.h
index 0f797a55d504..5409a1cfb688 100644
--- a/drivers/scsi/bfa/bfa_fcs.h
+++ b/drivers/scsi/bfa/bfa_fcs.h
@@ -308,16 +308,7 @@ void bfa_fcs_lport_clear_stats(struct bfa_fcs_lport_s *fcs_port);
 enum bfa_port_speed bfa_fcs_lport_get_rport_max_speed(
 			struct bfa_fcs_lport_s *port);
 
-/* MS FCS routines */
-void bfa_fcs_lport_ms_init(struct bfa_fcs_lport_s *port);
-void bfa_fcs_lport_ms_offline(struct bfa_fcs_lport_s *port);
-void bfa_fcs_lport_ms_online(struct bfa_fcs_lport_s *port);
-void bfa_fcs_lport_ms_fabric_rscn(struct bfa_fcs_lport_s *port);
-
 /* FDMI FCS routines */
-void bfa_fcs_lport_fdmi_init(struct bfa_fcs_lport_ms_s *ms);
-void bfa_fcs_lport_fdmi_offline(struct bfa_fcs_lport_ms_s *ms);
-void bfa_fcs_lport_fdmi_online(struct bfa_fcs_lport_ms_s *ms);
 void bfa_fcs_lport_uf_recv(struct bfa_fcs_lport_s *lport, struct fchs_s *fchs,
 				     u16 len);
 void bfa_fcs_lport_attach(struct bfa_fcs_lport_s *lport, struct bfa_fcs_s *fcs,
@@ -328,10 +319,6 @@ void            bfa_fcs_lport_online(struct bfa_fcs_lport_s *port);
 void            bfa_fcs_lport_offline(struct bfa_fcs_lport_s *port);
 void            bfa_fcs_lport_delete(struct bfa_fcs_lport_s *port);
 void		bfa_fcs_lport_stop(struct bfa_fcs_lport_s *port);
-struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_pid(
-		struct bfa_fcs_lport_s *port, u32 pid);
-struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_old_pid(
-		struct bfa_fcs_lport_s *port, u32 pid);
 struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_pwwn(
 		struct bfa_fcs_lport_s *port, wwn_t pwwn);
 struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_nwwn(
@@ -342,17 +329,6 @@ void            bfa_fcs_lport_add_rport(struct bfa_fcs_lport_s *port,
 				       struct bfa_fcs_rport_s *rport);
 void            bfa_fcs_lport_del_rport(struct bfa_fcs_lport_s *port,
 				       struct bfa_fcs_rport_s *rport);
-void            bfa_fcs_lport_ns_init(struct bfa_fcs_lport_s *vport);
-void            bfa_fcs_lport_ns_offline(struct bfa_fcs_lport_s *vport);
-void            bfa_fcs_lport_ns_online(struct bfa_fcs_lport_s *vport);
-void            bfa_fcs_lport_ns_query(struct bfa_fcs_lport_s *port);
-void		bfa_fcs_lport_ns_util_send_rspn_id(void *cbarg,
-				struct bfa_fcxp_s *fcxp_alloced);
-void            bfa_fcs_lport_scn_init(struct bfa_fcs_lport_s *vport);
-void            bfa_fcs_lport_scn_offline(struct bfa_fcs_lport_s *vport);
-void            bfa_fcs_lport_fab_scn_online(struct bfa_fcs_lport_s *vport);
-void            bfa_fcs_lport_scn_process_rscn(struct bfa_fcs_lport_s *port,
-					      struct fchs_s *rx_frame, u32 len);
 void		bfa_fcs_lport_lip_scn_online(bfa_fcs_lport_t *port);
 
 struct bfa_fcs_vport_s {
@@ -391,10 +367,8 @@ struct bfa_fcs_vport_s *bfa_fcs_vport_lookup(struct bfa_fcs_s *fcs,
 void bfa_fcs_vport_cleanup(struct bfa_fcs_vport_s *vport);
 void bfa_fcs_vport_online(struct bfa_fcs_vport_s *vport);
 void bfa_fcs_vport_offline(struct bfa_fcs_vport_s *vport);
-void bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport);
 void bfa_fcs_vport_fcs_delete(struct bfa_fcs_vport_s *vport);
 void bfa_fcs_vport_fcs_stop(struct bfa_fcs_vport_s *vport);
-void bfa_fcs_vport_stop_comp(struct bfa_fcs_vport_s *vport);
 
 #define BFA_FCS_RPORT_DEF_DEL_TIMEOUT	90	/* in secs */
 #define BFA_FCS_RPORT_MAX_RETRIES	(5)
@@ -494,9 +468,6 @@ void bfa_fcs_rport_fcptm_offline_done(struct bfa_fcs_rport_s *rport);
 int  bfa_fcs_rport_get_state(struct bfa_fcs_rport_s *rport);
 struct bfa_fcs_rport_s *bfa_fcs_rport_create_by_wwn(
 			struct bfa_fcs_lport_s *port, wwn_t wwn);
-void  bfa_fcs_rpf_init(struct bfa_fcs_rport_s *rport);
-void  bfa_fcs_rpf_rport_online(struct bfa_fcs_rport_s *rport);
-void  bfa_fcs_rpf_rport_offline(struct bfa_fcs_rport_s *rport);
 
 /*
  * forward declarations
@@ -808,11 +779,6 @@ void bfa_fcs_vf_get_ports(bfa_fcs_vf_t *vf, wwn_t vpwwn[], int *nports);
 /*
  * fabric protected interface functions
  */
-void bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs);
-void bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs);
-void bfa_fcs_fabric_modexit(struct bfa_fcs_s *fcs);
-void bfa_fcs_fabric_link_up(struct bfa_fcs_fabric_s *fabric);
-void bfa_fcs_fabric_link_down(struct bfa_fcs_fabric_s *fabric);
 void bfa_fcs_fabric_addvport(struct bfa_fcs_fabric_s *fabric,
 	struct bfa_fcs_vport_s *vport);
 void bfa_fcs_fabric_delvport(struct bfa_fcs_fabric_s *fabric,
@@ -820,16 +786,9 @@ void bfa_fcs_fabric_delvport(struct bfa_fcs_fabric_s *fabric,
 struct bfa_fcs_vport_s *bfa_fcs_fabric_vport_lookup(
 		struct bfa_fcs_fabric_s *fabric, wwn_t pwwn);
 void bfa_fcs_fabric_modstart(struct bfa_fcs_s *fcs);
-void bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric,
-		struct fchs_s *fchs, u16 len);
-void	bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric);
-void	bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric);
 void bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric,
 	       wwn_t fabric_name);
 u16 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric);
-void bfa_fcs_uf_attach(struct bfa_fcs_s *fcs);
-void bfa_fcs_port_attach(struct bfa_fcs_s *fcs);
-void bfa_fcs_fabric_modstop(struct bfa_fcs_s *fcs);
 void bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric,
 			enum bfa_fcs_fabric_event event);
 void bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric,
diff --git a/drivers/scsi/bfa/bfa_fcs_lport.c b/drivers/scsi/bfa/bfa_fcs_lport.c
index 7733ad5305d4..7870baedb9bd 100644
--- a/drivers/scsi/bfa/bfa_fcs_lport.c
+++ b/drivers/scsi/bfa/bfa_fcs_lport.c
@@ -84,6 +84,28 @@ static void	bfa_fcs_lport_loop_init(struct bfa_fcs_lport_s *port);
 static void	bfa_fcs_lport_loop_online(struct bfa_fcs_lport_s *port);
 static void	bfa_fcs_lport_loop_offline(struct bfa_fcs_lport_s *port);
 
+static void	bfa_fcs_lport_scn_process_rscn(struct bfa_fcs_lport_s *port,
+					       struct fchs_s *fchs, u32 len);
+static void	bfa_fcs_lport_scn_init(struct bfa_fcs_lport_s *port);
+static void	bfa_fcs_lport_scn_offline(struct bfa_fcs_lport_s *port);
+static void	bfa_fcs_lport_fab_scn_online(struct bfa_fcs_lport_s *port);
+
+static void	bfa_fcs_lport_ns_init(struct bfa_fcs_lport_s *port);
+static void	bfa_fcs_lport_ns_offline(struct bfa_fcs_lport_s *port);
+static void	bfa_fcs_lport_ns_online(struct bfa_fcs_lport_s *port);
+static void	bfa_fcs_lport_ns_util_send_rspn_id(void *cbarg,
+					   struct bfa_fcxp_s *fcxp_alloced);
+
+static void	bfa_fcs_lport_ms_init(struct bfa_fcs_lport_s *port);
+static void	bfa_fcs_lport_ms_offline(struct bfa_fcs_lport_s *port);
+static void	bfa_fcs_lport_ms_online(struct bfa_fcs_lport_s *port);
+
+static struct bfa_fcs_rport_s *
+		bfa_fcs_lport_get_rport_by_pid(struct bfa_fcs_lport_s *port,
+					       u32 pid);
+
+static void	bfa_fcs_vport_stop_comp(struct bfa_fcs_vport_s *vport);
+static void	bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport);
 static struct {
 	void		(*init) (struct bfa_fcs_lport_s *port);
 	void		(*online) (struct bfa_fcs_lport_s *port);
@@ -893,7 +915,7 @@ bfa_fcs_lport_uf_recv(struct bfa_fcs_lport_s *lport,
 /*
  *   PID based Lookup for a R-Port in the Port R-Port Queue
  */
-struct bfa_fcs_rport_s *
+static struct bfa_fcs_rport_s *
 bfa_fcs_lport_get_rport_by_pid(struct bfa_fcs_lport_s *port, u32 pid)
 {
 	struct bfa_fcs_rport_s *rport;
@@ -912,7 +934,7 @@ bfa_fcs_lport_get_rport_by_pid(struct bfa_fcs_lport_s *port, u32 pid)
 /*
  * OLD_PID based Lookup for a R-Port in the Port R-Port Queue
  */
-struct bfa_fcs_rport_s *
+static struct bfa_fcs_rport_s *
 bfa_fcs_lport_get_rport_by_old_pid(struct bfa_fcs_lport_s *port, u32 pid)
 {
 	struct bfa_fcs_rport_s *rport;
@@ -1280,7 +1302,7 @@ bfa_fcs_lport_n2n_offline(struct bfa_fcs_lport_s *port)
 	n2n_port->reply_oxid = 0;
 }
 
-void
+static void
 bfa_fcport_get_loop_attr(struct bfa_fcs_lport_s *port)
 {
 	int i = 0, j = 0, bit = 0, alpa_bit = 0;
@@ -1417,7 +1439,7 @@ static void	bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_lport_fdmi_s *fdmi,
 				 struct bfa_fcs_fdmi_hba_attr_s *hba_attr);
 static void	bfa_fcs_fdmi_get_portattr(struct bfa_fcs_lport_fdmi_s *fdmi,
 				  struct bfa_fcs_fdmi_port_attr_s *port_attr);
-u32	bfa_fcs_fdmi_convert_speed(enum bfa_port_speed pport_speed);
+static u32	bfa_fcs_fdmi_convert_speed(enum bfa_port_speed pport_speed);
 
 /*
  *  fcs_fdmi_sm FCS FDMI state machine
@@ -2751,7 +2773,7 @@ bfa_fcs_fdmi_get_portattr(struct bfa_fcs_lport_fdmi_s *fdmi,
 /*
  * Convert BFA speed to FDMI format.
  */
-u32
+static u32
 bfa_fcs_fdmi_convert_speed(bfa_port_speed_t pport_speed)
 {
 	u32	ret;
@@ -2784,7 +2806,7 @@ bfa_fcs_fdmi_convert_speed(bfa_port_speed_t pport_speed)
 	return ret;
 }
 
-void
+static void
 bfa_fcs_lport_fdmi_init(struct bfa_fcs_lport_ms_s *ms)
 {
 	struct bfa_fcs_lport_fdmi_s *fdmi = &ms->fdmi;
@@ -2796,7 +2818,7 @@ bfa_fcs_lport_fdmi_init(struct bfa_fcs_lport_ms_s *ms)
 		bfa_sm_set_state(fdmi, bfa_fcs_lport_fdmi_sm_disabled);
 }
 
-void
+static void
 bfa_fcs_lport_fdmi_offline(struct bfa_fcs_lport_ms_s *ms)
 {
 	struct bfa_fcs_lport_fdmi_s *fdmi = &ms->fdmi;
@@ -2805,7 +2827,7 @@ bfa_fcs_lport_fdmi_offline(struct bfa_fcs_lport_ms_s *ms)
 	bfa_sm_send_event(fdmi, FDMISM_EVENT_PORT_OFFLINE);
 }
 
-void
+static void
 bfa_fcs_lport_fdmi_online(struct bfa_fcs_lport_ms_s *ms)
 {
 	struct bfa_fcs_lport_fdmi_s *fdmi = &ms->fdmi;
@@ -3506,7 +3528,7 @@ bfa_fcs_lport_ms_timeout(void *arg)
 }
 
 
-void
+static void
 bfa_fcs_lport_ms_init(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_ms_s *ms = BFA_FCS_GET_MS_FROM_PORT(port);
@@ -3520,7 +3542,7 @@ bfa_fcs_lport_ms_init(struct bfa_fcs_lport_s *port)
 	bfa_fcs_lport_fdmi_init(ms);
 }
 
-void
+static void
 bfa_fcs_lport_ms_offline(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_ms_s *ms = BFA_FCS_GET_MS_FROM_PORT(port);
@@ -3530,7 +3552,7 @@ bfa_fcs_lport_ms_offline(struct bfa_fcs_lport_s *port)
 	bfa_fcs_lport_fdmi_offline(ms);
 }
 
-void
+static void
 bfa_fcs_lport_ms_online(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_ms_s *ms = BFA_FCS_GET_MS_FROM_PORT(port);
@@ -3538,7 +3560,8 @@ bfa_fcs_lport_ms_online(struct bfa_fcs_lport_s *port)
 	ms->port = port;
 	bfa_sm_send_event(ms, MSSM_EVENT_PORT_ONLINE);
 }
-void
+
+static void
 bfa_fcs_lport_ms_fabric_rscn(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_ms_s *ms = BFA_FCS_GET_MS_FROM_PORT(port);
@@ -5100,7 +5123,7 @@ bfa_fcs_lport_ns_process_gidft_pids(struct bfa_fcs_lport_s *port, u32 *pid_buf,
  * Functions called by port/fab.
  * These will send relevant Events to the ns state machine.
  */
-void
+static void
 bfa_fcs_lport_ns_init(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_ns_s *ns = BFA_FCS_GET_NS_FROM_PORT(port);
@@ -5109,7 +5132,7 @@ bfa_fcs_lport_ns_init(struct bfa_fcs_lport_s *port)
 	bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_offline);
 }
 
-void
+static void
 bfa_fcs_lport_ns_offline(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_ns_s *ns = BFA_FCS_GET_NS_FROM_PORT(port);
@@ -5118,7 +5141,7 @@ bfa_fcs_lport_ns_offline(struct bfa_fcs_lport_s *port)
 	bfa_sm_send_event(ns, NSSM_EVENT_PORT_OFFLINE);
 }
 
-void
+static void
 bfa_fcs_lport_ns_online(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_ns_s *ns = BFA_FCS_GET_NS_FROM_PORT(port);
@@ -5127,7 +5150,7 @@ bfa_fcs_lport_ns_online(struct bfa_fcs_lport_s *port)
 	bfa_sm_send_event(ns, NSSM_EVENT_PORT_ONLINE);
 }
 
-void
+static void
 bfa_fcs_lport_ns_query(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_ns_s *ns = BFA_FCS_GET_NS_FROM_PORT(port);
@@ -5154,7 +5177,7 @@ bfa_fcs_lport_ns_boot_target_disc(bfa_fcs_lport_t *port)
 	}
 }
 
-void
+static void
 bfa_fcs_lport_ns_util_send_rspn_id(void *cbarg, struct bfa_fcxp_s *fcxp_alloced)
 {
 	struct bfa_fcs_lport_ns_s *ns = cbarg;
@@ -5518,7 +5541,7 @@ bfa_fcs_lport_scn_timeout(void *arg)
 /*
  * Functions called by port/fab
  */
-void
+static void
 bfa_fcs_lport_scn_init(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_scn_s *scn = BFA_FCS_GET_SCN_FROM_PORT(port);
@@ -5527,7 +5550,7 @@ bfa_fcs_lport_scn_init(struct bfa_fcs_lport_s *port)
 	bfa_sm_set_state(scn, bfa_fcs_lport_scn_sm_offline);
 }
 
-void
+static void
 bfa_fcs_lport_scn_offline(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_scn_s *scn = BFA_FCS_GET_SCN_FROM_PORT(port);
@@ -5536,7 +5559,7 @@ bfa_fcs_lport_scn_offline(struct bfa_fcs_lport_s *port)
 	bfa_sm_send_event(scn, SCNSM_EVENT_PORT_OFFLINE);
 }
 
-void
+static void
 bfa_fcs_lport_fab_scn_online(struct bfa_fcs_lport_s *port)
 {
 	struct bfa_fcs_lport_scn_s *scn = BFA_FCS_GET_SCN_FROM_PORT(port);
@@ -5621,7 +5644,7 @@ bfa_fcs_lport_scn_multiport_rscn(struct bfa_fcs_lport_s *port,
 }
 
 
-void
+static void
 bfa_fcs_lport_scn_process_rscn(struct bfa_fcs_lport_s *port,
 			struct fchs_s *fchs, u32 len)
 {
@@ -6680,7 +6703,7 @@ bfa_fcs_vport_fcs_delete(struct bfa_fcs_vport_s *vport)
 /*
  * Stop completion callback from associated lport
  */
-void
+static void
 bfa_fcs_vport_stop_comp(struct bfa_fcs_vport_s *vport)
 {
 	bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_STOPCOMP);
@@ -6689,7 +6712,7 @@ bfa_fcs_vport_stop_comp(struct bfa_fcs_vport_s *vport)
 /*
  * Delete completion callback from associated lport
  */
-void
+static void
 bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport)
 {
 	bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_DELCOMP);
diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c
index de50349a39ce..1d722e272f18 100644
--- a/drivers/scsi/bfa/bfa_fcs_rport.c
+++ b/drivers/scsi/bfa/bfa_fcs_rport.c
@@ -143,6 +143,9 @@ static void	bfa_fcs_rport_sm_fc4_off_delete(struct bfa_fcs_rport_s *rport,
 						enum rport_event event);
 static void	bfa_fcs_rport_sm_delete_pending(struct bfa_fcs_rport_s *rport,
 						enum rport_event event);
+static void bfa_fcs_rpf_init(struct bfa_fcs_rport_s *rport);
+static void bfa_fcs_rpf_rport_online(struct bfa_fcs_rport_s *rport);
+static void bfa_fcs_rpf_rport_offline(struct bfa_fcs_rport_s *rport);
 
 static struct bfa_sm_table_s rport_sm_table[] = {
 	{BFA_SM(bfa_fcs_rport_sm_uninit), BFA_RPORT_UNINIT},
@@ -3321,7 +3324,7 @@ bfa_fcs_rpf_sm_offline(struct bfa_fcs_rpf_s *rpf, enum rpf_event event)
 /*
  * Called when Rport is created.
  */
-void
+static void
 bfa_fcs_rpf_init(struct bfa_fcs_rport_s *rport)
 {
 	struct bfa_fcs_rpf_s *rpf = &rport->rpf;
@@ -3335,7 +3338,7 @@ bfa_fcs_rpf_init(struct bfa_fcs_rport_s *rport)
 /*
  * Called when Rport becomes online
  */
-void
+static void
 bfa_fcs_rpf_rport_online(struct bfa_fcs_rport_s *rport)
 {
 	bfa_trc(rport->fcs, rport->pid);
@@ -3350,7 +3353,7 @@ bfa_fcs_rpf_rport_online(struct bfa_fcs_rport_s *rport)
 /*
  * Called when Rport becomes offline
  */
-void
+static void
 bfa_fcs_rpf_rport_offline(struct bfa_fcs_rport_s *rport)
 {
 	bfa_trc(rport->fcs, rport->pid);
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index a1ada4a31c97..d2974797e52d 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -118,6 +118,14 @@ static enum bfi_ioc_img_ver_cmp_e bfa_ioc_fw_ver_patch_cmp(
 static enum bfi_ioc_img_ver_cmp_e bfa_ioc_flash_fwver_cmp(
 				struct bfa_ioc_s *ioc,
 				struct bfi_ioc_image_hdr_s *base_fwhdr);
+static void bfa_ioc_aen_post(struct bfa_ioc_s *ioc,
+			     enum bfa_ioc_aen_event event);
+static bfa_status_t bfa_ioc_boot(struct bfa_ioc_s *ioc, u32 boot_type,
+				 u32 boot_env);
+static bfa_status_t bfa_flash_raw_read(void __iomem *pci_bar, u32 offset,
+				       char *buf, u32 len);
+static void bfa_phy_intr(void *phyarg, struct bfi_mbmsg_s *msg);
+static void bfa_fru_intr(void *fruarg, struct bfi_mbmsg_s *msg);
 
 /*
  * IOC state machine definitions/declarations
@@ -1638,7 +1646,7 @@ bfa_ioc_fw_ver_patch_cmp(struct bfi_ioc_image_hdr_s *base_fwhdr,
 
 #define BFA_FLASH_PART_FWIMG_ADDR	0x100000 /* fw image address */
 
-bfa_status_t
+static bfa_status_t
 bfa_ioc_flash_img_get_chnk(struct bfa_ioc_s *ioc, u32 off,
 				u32 *fwimg)
 {
@@ -2192,7 +2200,7 @@ bfa_ioc_pf_fwmismatch(struct bfa_ioc_s *ioc)
 	bfa_ioc_aen_post(ioc, BFA_IOC_AEN_FWMISMATCH);
 }
 
-bfa_status_t
+static bfa_status_t
 bfa_ioc_pll_init(struct bfa_ioc_s *ioc)
 {
 
@@ -2223,7 +2231,7 @@ bfa_ioc_pll_init(struct bfa_ioc_s *ioc)
  * Interface used by diag module to do firmware boot with memory test
  * as the entry vector.
  */
-bfa_status_t
+static bfa_status_t
 bfa_ioc_boot(struct bfa_ioc_s *ioc, u32 boot_type, u32 boot_env)
 {
 	struct bfi_ioc_image_hdr_s *drv_fwhdr;
@@ -2297,7 +2305,7 @@ bfa_ioc_is_initialized(struct bfa_ioc_s *ioc)
 		(r32 != BFI_IOC_MEMTEST));
 }
 
-bfa_boolean_t
+static bfa_boolean_t
 bfa_ioc_msgget(struct bfa_ioc_s *ioc, void *mbmsg)
 {
 	__be32	*msgp = mbmsg;
@@ -2327,7 +2335,7 @@ bfa_ioc_msgget(struct bfa_ioc_s *ioc, void *mbmsg)
 	return BFA_TRUE;
 }
 
-void
+static void
 bfa_ioc_isr(struct bfa_ioc_s *ioc, struct bfi_mbmsg_s *m)
 {
 	union bfi_ioc_i2h_msg_u	*msg;
@@ -2667,7 +2675,7 @@ bfa_ioc_fw_mismatch(struct bfa_ioc_s *ioc)
  * Check if adapter is disabled -- both IOCs should be in a disabled
  * state.
  */
-bfa_boolean_t
+static bfa_boolean_t
 bfa_ioc_adapter_is_disabled(struct bfa_ioc_s *ioc)
 {
 	u32	ioc_state;
@@ -2691,7 +2699,7 @@ bfa_ioc_adapter_is_disabled(struct bfa_ioc_s *ioc)
 /*
  * Reset IOC fwstate registers.
  */
-void
+static void
 bfa_ioc_reset_fwstate(struct bfa_ioc_s *ioc)
 {
 	bfa_ioc_set_cur_ioc_fwstate(ioc, BFI_IOC_UNINIT);
@@ -2699,7 +2707,7 @@ bfa_ioc_reset_fwstate(struct bfa_ioc_s *ioc)
 }
 
 #define BFA_MFG_NAME "QLogic"
-void
+static void
 bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc,
 			 struct bfa_adapter_attr_s *ad_attr)
 {
@@ -2826,7 +2834,7 @@ bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model)
 			BFA_MFG_NAME, ioc_attr->card_type);
 }
 
-enum bfa_ioc_state
+static enum bfa_ioc_state
 bfa_ioc_get_state(struct bfa_ioc_s *ioc)
 {
 	enum bfa_iocpf_state iocpf_st;
@@ -2917,7 +2925,7 @@ bfa_ioc_get_mfg_mac(struct bfa_ioc_s *ioc)
 /*
  * Send AEN notification
  */
-void
+static void
 bfa_ioc_aen_post(struct bfa_ioc_s *ioc, enum bfa_ioc_aen_event event)
 {
 	struct bfad_s *bfad = (struct bfad_s *)ioc->bfa->bfad;
@@ -3996,7 +4004,7 @@ bfa_sfp_speed_valid(struct bfa_sfp_s *sfp, enum bfa_port_speed portspeed)
 /*
  *	SFP hmbox handler
  */
-void
+static void
 bfa_sfp_intr(void *sfparg, struct bfi_mbmsg_s *msg)
 {
 	struct bfa_sfp_s *sfp = sfparg;
@@ -5036,7 +5044,7 @@ diag_portbeacon_comp(struct bfa_diag_s *diag)
 /*
  *	Diag hmbox handler
  */
-void
+static void
 bfa_diag_intr(void *diagarg, struct bfi_mbmsg_s *msg)
 {
 	struct bfa_diag_s *diag = diagarg;
@@ -5515,7 +5523,7 @@ bfa_phy_memclaim(struct bfa_phy_s *phy, u8 *dm_kva, u64 dm_pa,
 	dm_pa += BFA_ROUNDUP(BFA_PHY_DMA_BUF_SZ, BFA_DMA_ALIGN_SZ);
 }
 
-bfa_boolean_t
+static bfa_boolean_t
 bfa_phy_busy(struct bfa_ioc_s *ioc)
 {
 	void __iomem	*rb;
@@ -5710,7 +5718,7 @@ bfa_phy_read(struct bfa_phy_s *phy, u8 instance,
  * @param[in] phyarg - phy structure
  * @param[in] msg - message structure
  */
-void
+static void
 bfa_phy_intr(void *phyarg, struct bfi_mbmsg_s *msg)
 {
 	struct bfa_phy_s *phy = phyarg;
@@ -6582,7 +6590,7 @@ bfa_tfru_read(struct bfa_fru_s *fru, void *buf, u32 len, u32 offset,
  * @param[in] fruarg - fru structure
  * @param[in] msg - message structure
  */
-void
+static void
 bfa_fru_intr(void *fruarg, struct bfi_mbmsg_s *msg)
 {
 	struct bfa_fru_s *fru = fruarg;
@@ -6999,7 +7007,7 @@ bfa_raw_sem_get(void __iomem *bar)
 
 }
 
-bfa_status_t
+static bfa_status_t
 bfa_flash_sem_get(void __iomem *bar)
 {
 	u32 n = FLASH_BLOCKING_OP_MAX;
@@ -7012,13 +7020,13 @@ bfa_flash_sem_get(void __iomem *bar)
 	return BFA_STATUS_OK;
 }
 
-void
+static void
 bfa_flash_sem_put(void __iomem *bar)
 {
 	writel(0, (bar + FLASH_SEM_LOCK_REG));
 }
 
-bfa_status_t
+static bfa_status_t
 bfa_flash_raw_read(void __iomem *pci_bar, u32 offset, char *buf,
 		       u32 len)
 {
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h
index 713745da44c6..a2df03dc420a 100644
--- a/drivers/scsi/bfa/bfa_ioc.h
+++ b/drivers/scsi/bfa/bfa_ioc.h
@@ -454,7 +454,6 @@ void	bfa_sfp_attach(struct bfa_sfp_s *sfp, struct bfa_ioc_s *ioc,
 			void *dev, struct bfa_trc_mod_s *trcmod);
 
 void	bfa_sfp_memclaim(struct bfa_sfp_s *diag, u8 *dm_kva, u64 dm_pa);
-void	bfa_sfp_intr(void *bfaarg, struct bfi_mbmsg_s *msg);
 
 bfa_status_t	bfa_sfp_show(struct bfa_sfp_s *sfp, struct sfp_mem_s *sfpmem,
 			     bfa_cb_sfp_t cbfn, void *cbarg);
@@ -516,8 +515,6 @@ void bfa_flash_attach(struct bfa_flash_s *flash, struct bfa_ioc_s *ioc,
 		void *dev, struct bfa_trc_mod_s *trcmod, bfa_boolean_t mincfg);
 void bfa_flash_memclaim(struct bfa_flash_s *flash,
 		u8 *dm_kva, u64 dm_pa, bfa_boolean_t mincfg);
-bfa_status_t    bfa_flash_raw_read(void __iomem *pci_bar_kva,
-				u32 offset, char *buf, u32 len);
 
 /*
  *	DIAG module specific
@@ -689,7 +686,6 @@ struct bfa_phy_s {
 #define BFA_PHY(__bfa)	(&(__bfa)->modules.phy)
 #define BFA_MEM_PHY_DMA(__bfa)	(&(BFA_PHY(__bfa)->phy_dma))
 
-bfa_boolean_t bfa_phy_busy(struct bfa_ioc_s *ioc);
 bfa_status_t bfa_phy_get_attr(struct bfa_phy_s *phy, u8 instance,
 			struct bfa_phy_attr_s *attr,
 			bfa_cb_phy_t cbfn, void *cbarg);
@@ -708,7 +704,6 @@ void bfa_phy_attach(struct bfa_phy_s *phy, struct bfa_ioc_s *ioc,
 		void *dev, struct bfa_trc_mod_s *trcmod, bfa_boolean_t mincfg);
 void bfa_phy_memclaim(struct bfa_phy_s *phy,
 		u8 *dm_kva, u64 dm_pa, bfa_boolean_t mincfg);
-void bfa_phy_intr(void *phyarg, struct bfi_mbmsg_s *msg);
 
 /*
  * FRU module specific
@@ -758,7 +753,6 @@ void bfa_fru_attach(struct bfa_fru_s *fru, struct bfa_ioc_s *ioc,
 		void *dev, struct bfa_trc_mod_s *trcmod, bfa_boolean_t mincfg);
 void bfa_fru_memclaim(struct bfa_fru_s *fru,
 		u8 *dm_kva, u64 dm_pa, bfa_boolean_t mincfg);
-void bfa_fru_intr(void *fruarg, struct bfi_mbmsg_s *msg);
 
 /*
  * Driver Config( dconf) specific
@@ -845,7 +839,6 @@ void bfa_ioc_mbox_register(struct bfa_ioc_s *ioc,
 		bfa_ioc_mbox_mcfunc_t *mcfuncs);
 void bfa_ioc_mbox_isr(struct bfa_ioc_s *ioc);
 void bfa_ioc_mbox_send(struct bfa_ioc_s *ioc, void *ioc_msg, int len);
-bfa_boolean_t bfa_ioc_msgget(struct bfa_ioc_s *ioc, void *mbmsg);
 void bfa_ioc_mbox_regisr(struct bfa_ioc_s *ioc, enum bfi_mclass mc,
 		bfa_ioc_mbox_mcfunc_t cbfn, void *cbarg);
 
@@ -857,11 +850,6 @@ void bfa_ioc_mbox_regisr(struct bfa_ioc_s *ioc, enum bfi_mclass mc,
 	((__ioc)->ioc_hwif->ioc_pll_init((__ioc)->pcidev.pci_bar_kva, \
 			   (__ioc)->asic_mode))
 
-bfa_status_t bfa_ioc_pll_init(struct bfa_ioc_s *ioc);
-bfa_status_t bfa_ioc_cb_pll_init(void __iomem *rb, enum bfi_asic_mode mode);
-bfa_status_t bfa_ioc_ct_pll_init(void __iomem *rb, enum bfi_asic_mode mode);
-bfa_status_t bfa_ioc_ct2_pll_init(void __iomem *rb, enum bfi_asic_mode mode);
-
 #define bfa_ioc_isr_mode_set(__ioc, __msix) do {			\
 	if ((__ioc)->ioc_hwif->ioc_isr_mode_set)			\
 		((__ioc)->ioc_hwif->ioc_isr_mode_set(__ioc, __msix));	\
@@ -891,17 +879,12 @@ void bfa_ioc_enable(struct bfa_ioc_s *ioc);
 void bfa_ioc_disable(struct bfa_ioc_s *ioc);
 bfa_boolean_t bfa_ioc_intx_claim(struct bfa_ioc_s *ioc);
 
-bfa_status_t bfa_ioc_boot(struct bfa_ioc_s *ioc, u32 boot_type,
-		u32 boot_env);
-void bfa_ioc_isr(struct bfa_ioc_s *ioc, struct bfi_mbmsg_s *msg);
 void bfa_ioc_error_isr(struct bfa_ioc_s *ioc);
 bfa_boolean_t bfa_ioc_is_operational(struct bfa_ioc_s *ioc);
 bfa_boolean_t bfa_ioc_is_initialized(struct bfa_ioc_s *ioc);
 bfa_boolean_t bfa_ioc_is_disabled(struct bfa_ioc_s *ioc);
 bfa_boolean_t bfa_ioc_is_acq_addr(struct bfa_ioc_s *ioc);
 bfa_boolean_t bfa_ioc_fw_mismatch(struct bfa_ioc_s *ioc);
-bfa_boolean_t bfa_ioc_adapter_is_disabled(struct bfa_ioc_s *ioc);
-void bfa_ioc_reset_fwstate(struct bfa_ioc_s *ioc);
 enum bfa_ioc_type_e bfa_ioc_get_type(struct bfa_ioc_s *ioc);
 void bfa_ioc_get_adapter_serial_num(struct bfa_ioc_s *ioc, char *serial_num);
 void bfa_ioc_get_adapter_fw_ver(struct bfa_ioc_s *ioc, char *fw_ver);
@@ -910,11 +893,8 @@ void bfa_ioc_get_adapter_model(struct bfa_ioc_s *ioc, char *model);
 void bfa_ioc_get_adapter_manufacturer(struct bfa_ioc_s *ioc,
 		char *manufacturer);
 void bfa_ioc_get_pci_chip_rev(struct bfa_ioc_s *ioc, char *chip_rev);
-enum bfa_ioc_state bfa_ioc_get_state(struct bfa_ioc_s *ioc);
 
 void bfa_ioc_get_attr(struct bfa_ioc_s *ioc, struct bfa_ioc_attr_s *ioc_attr);
-void bfa_ioc_get_adapter_attr(struct bfa_ioc_s *ioc,
-		struct bfa_adapter_attr_s *ad_attr);
 void bfa_ioc_debug_memclaim(struct bfa_ioc_s *ioc, void *dbg_fwsave);
 bfa_status_t bfa_ioc_debug_fwsave(struct bfa_ioc_s *ioc, void *trcdata,
 		int *trclen);
@@ -928,7 +908,6 @@ void bfa_ioc_fwver_get(struct bfa_ioc_s *ioc,
 			struct bfi_ioc_image_hdr_s *fwhdr);
 bfa_boolean_t bfa_ioc_fwver_cmp(struct bfa_ioc_s *ioc,
 			struct bfi_ioc_image_hdr_s *fwhdr);
-void bfa_ioc_aen_post(struct bfa_ioc_s *ioc, enum bfa_ioc_aen_event event);
 bfa_status_t bfa_ioc_fw_stats_get(struct bfa_ioc_s *ioc, void *stats);
 bfa_status_t bfa_ioc_fw_stats_clear(struct bfa_ioc_s *ioc);
 void bfa_ioc_debug_save_ftrc(struct bfa_ioc_s *ioc);
@@ -960,8 +939,6 @@ bfa_status_t bfa_ablk_optrom_en(struct bfa_ablk_s *ablk,
 bfa_status_t bfa_ablk_optrom_dis(struct bfa_ablk_s *ablk,
 		bfa_ablk_cbfn_t cbfn, void *cbarg);
 
-bfa_status_t bfa_ioc_flash_img_get_chnk(struct bfa_ioc_s *ioc, u32 off,
-				u32 *fwimg);
 /*
  * bfa mfg wwn API functions
  */
diff --git a/drivers/scsi/bfa/bfa_ioc_cb.c b/drivers/scsi/bfa/bfa_ioc_cb.c
index f1b80da298c8..f1fc469d60cc 100644
--- a/drivers/scsi/bfa/bfa_ioc_cb.c
+++ b/drivers/scsi/bfa/bfa_ioc_cb.c
@@ -46,6 +46,7 @@ static enum bfi_ioc_state bfa_ioc_cb_get_cur_ioc_fwstate(struct bfa_ioc_s *ioc);
 static void bfa_ioc_cb_set_alt_ioc_fwstate(
 			struct bfa_ioc_s *ioc, enum bfi_ioc_state fwstate);
 static enum bfi_ioc_state bfa_ioc_cb_get_alt_ioc_fwstate(struct bfa_ioc_s *ioc);
+static bfa_status_t bfa_ioc_cb_pll_init(void __iomem *rb, enum bfi_asic_mode fcmode);
 
 static struct bfa_ioc_hwif_s hwif_cb;
 
@@ -361,7 +362,7 @@ bfa_ioc_cb_sync_complete(struct bfa_ioc_s *ioc)
 	}
 }
 
-bfa_status_t
+static bfa_status_t
 bfa_ioc_cb_pll_init(void __iomem *rb, enum bfi_asic_mode fcmode)
 {
 	u32	pll_sclk, pll_fclk, join_bits;
diff --git a/drivers/scsi/bfa/bfa_ioc_ct.c b/drivers/scsi/bfa/bfa_ioc_ct.c
index 651a8fb93037..12a9529b525f 100644
--- a/drivers/scsi/bfa/bfa_ioc_ct.c
+++ b/drivers/scsi/bfa/bfa_ioc_ct.c
@@ -50,6 +50,10 @@ static enum bfi_ioc_state bfa_ioc_ct_get_cur_ioc_fwstate(struct bfa_ioc_s *ioc);
 static void bfa_ioc_ct_set_alt_ioc_fwstate(
 			struct bfa_ioc_s *ioc, enum bfi_ioc_state fwstate);
 static enum bfi_ioc_state bfa_ioc_ct_get_alt_ioc_fwstate(struct bfa_ioc_s *ioc);
+static bfa_status_t bfa_ioc_ct_pll_init(void __iomem *rb,
+					enum bfi_asic_mode mode);
+static bfa_status_t bfa_ioc_ct2_pll_init(void __iomem *rb,
+					 enum bfi_asic_mode mode);
 
 static struct bfa_ioc_hwif_s hwif_ct;
 static struct bfa_ioc_hwif_s hwif_ct2;
@@ -372,7 +376,7 @@ bfa_ioc_ct_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t msix)
 	writel(r32, rb + FNC_PERS_REG);
 }
 
-bfa_boolean_t
+static bfa_boolean_t
 bfa_ioc_ct2_lpu_read_stat(struct bfa_ioc_s *ioc)
 {
 	u32	r32;
@@ -586,7 +590,7 @@ bfa_ioc_ct2_poweron(struct bfa_ioc_s *ioc)
 		rb + HOSTFN_MSIX_VT_INDEX_MBOX_ERR);
 }
 
-bfa_status_t
+static bfa_status_t
 bfa_ioc_ct_pll_init(void __iomem *rb, enum bfi_asic_mode mode)
 {
 	u32	pll_sclk, pll_fclk, r32;
@@ -752,7 +756,7 @@ bfa_ioc_ct2_mem_init(void __iomem *rb)
 	writel(0, (rb + CT2_MBIST_CTL_REG));
 }
 
-void
+static void
 bfa_ioc_ct2_mac_reset(void __iomem *rb)
 {
 	/* put port0, port1 MAC & AHB in reset */
@@ -892,7 +896,7 @@ bfa_ioc_ct2_wait_till_nfc_running(void __iomem *rb)
 	WARN_ON(!(r32 == CT2_NFC_STATE_RUNNING));
 }
 
-bfa_status_t
+static bfa_status_t
 bfa_ioc_ct2_pll_init(void __iomem *rb, enum bfi_asic_mode mode)
 {
 	u32 wgn, r32, nfc_ver;
diff --git a/drivers/scsi/bfa/bfa_plog.h b/drivers/scsi/bfa/bfa_plog.h
index da570c0b8275..57c27f14a4f6 100644
--- a/drivers/scsi/bfa/bfa_plog.h
+++ b/drivers/scsi/bfa/bfa_plog.h
@@ -144,13 +144,5 @@ struct bfa_plog_s {
 void bfa_plog_init(struct bfa_plog_s *plog);
 void bfa_plog_str(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
 			enum bfa_plog_eid event, u16 misc, char *log_str);
-void bfa_plog_intarr(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
-			enum bfa_plog_eid event, u16 misc,
-			u32 *intarr, u32 num_ints);
-void bfa_plog_fchdr(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
-		enum bfa_plog_eid event, u16 misc, struct fchs_s *fchdr);
-void bfa_plog_fchdr_and_pl(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
-			enum bfa_plog_eid event, u16 misc,
-			struct fchs_s *fchdr, u32 pld_w0);
 
 #endif /* __BFA_PORTLOG_H__ */
diff --git a/drivers/scsi/bfa/bfa_port.c b/drivers/scsi/bfa/bfa_port.c
index da1721e0d167..fa59395a5257 100644
--- a/drivers/scsi/bfa/bfa_port.c
+++ b/drivers/scsi/bfa/bfa_port.c
@@ -419,7 +419,7 @@ bfa_port_clear_stats(struct bfa_port_s *port, bfa_port_stats_cbfn_t cbfn,
  *
  * @return void
  */
-void
+static void
 bfa_port_notify(void *arg, enum bfa_ioc_event_e event)
 {
 	struct bfa_port_s *port = (struct bfa_port_s *) arg;
@@ -773,7 +773,7 @@ bfa_cee_reset_stats(struct bfa_cee_s *cee,
  * @return void
  */
 
-void
+static void
 bfa_cee_isr(void *cbarg, struct bfi_mbmsg_s *m)
 {
 	union bfi_cee_i2h_msg_u *msg;
@@ -809,7 +809,7 @@ bfa_cee_isr(void *cbarg, struct bfi_mbmsg_s *m)
  * @return void
  */
 
-void
+static void
 bfa_cee_notify(void *arg, enum bfa_ioc_event_e event)
 {
 	struct bfa_cee_s *cee = (struct bfa_cee_s *) arg;
diff --git a/drivers/scsi/bfa/bfa_port.h b/drivers/scsi/bfa/bfa_port.h
index 26dc1bf14c85..6587bcf064da 100644
--- a/drivers/scsi/bfa/bfa_port.h
+++ b/drivers/scsi/bfa/bfa_port.h
@@ -54,7 +54,6 @@ struct bfa_port_s {
 
 void	     bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc,
 				void *dev, struct bfa_trc_mod_s *trcmod);
-void	bfa_port_notify(void *arg, enum bfa_ioc_event_e event);
 
 bfa_status_t bfa_port_get_stats(struct bfa_port_s *port,
 				 union bfa_port_stats_u *stats,
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index 12de292175ef..5345ebb81646 100644
--- a/drivers/scsi/bfa/bfa_svc.c
+++ b/drivers/scsi/bfa/bfa_svc.c
@@ -117,6 +117,8 @@ static void	hal_fcxp_tx_plog(struct bfa_s *bfa, u32 reqlen,
 static void	bfa_fcxp_qresume(void *cbarg);
 static void	bfa_fcxp_queue(struct bfa_fcxp_s *fcxp,
 				struct bfi_fcxp_send_req_s *send_req);
+static void bfa_fcxp_free(struct bfa_fcxp_s *fcxp);
+
 
 /*
  * forward declarations for LPS functions
@@ -143,6 +145,7 @@ static void bfa_lps_send_set_n2n_pid(struct bfa_lps_s *lps);
 static void bfa_lps_login_comp(struct bfa_lps_s *lps);
 static void bfa_lps_logout_comp(struct bfa_lps_s *lps);
 static void bfa_lps_cvl_event(struct bfa_lps_s *lps);
+static u8 bfa_lps_get_fwtag(struct bfa_s *bfa, u8 lp_tag);
 
 /*
  * forward declaration for LPS state machine
@@ -175,6 +178,10 @@ static void __bfa_cb_fcport_stats_clr(void *cbarg, bfa_boolean_t complete);
 static void bfa_fcport_stats_get_timeout(void *cbarg);
 static void bfa_fcport_stats_clr_timeout(void *cbarg);
 static void bfa_trunk_iocdisable(struct bfa_s *bfa);
+static bfa_boolean_t bfa_fcport_is_qos_enabled(struct bfa_s *bfa);
+static bfa_boolean_t bfa_fcport_is_ddport(struct bfa_s *bfa);
+static bfa_boolean_t bfa_fcport_is_trunk_enabled(struct bfa_s *bfa);
+static bfa_status_t bfa_fcport_is_pbcdisabled(struct bfa_s *bfa);
 
 /*
  * forward declaration for FC PORT state machine
@@ -256,6 +263,7 @@ static void		__bfa_cb_rport_online(void *cbarg,
 						bfa_boolean_t complete);
 static void		__bfa_cb_rport_offline(void *cbarg,
 						bfa_boolean_t complete);
+static void bfa_rport_set_lunmask(struct bfa_s *bfa, struct bfa_rport_s *rp);
 
 /*
  * forward declaration for RPORT state machine
@@ -373,7 +381,7 @@ bfa_plog_str(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
 	}
 }
 
-void
+static void
 bfa_plog_intarr(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
 		enum bfa_plog_eid event,
 		u16 misc, u32 *intarr, u32 num_ints)
@@ -400,7 +408,7 @@ bfa_plog_intarr(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
 	}
 }
 
-void
+static void
 bfa_plog_fchdr(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
 			enum bfa_plog_eid event,
 			u16 misc, struct fchs_s *fchdr)
@@ -420,7 +428,7 @@ bfa_plog_fchdr(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
 	}
 }
 
-void
+static void
 bfa_plog_fchdr_and_pl(struct bfa_plog_s *plog, enum bfa_plog_mid mid,
 		      enum bfa_plog_eid event, u16 misc, struct fchs_s *fchdr,
 		      u32 pld_w0)
@@ -1021,7 +1029,7 @@ bfa_fcxp_get_rspbuf(struct bfa_fcxp_s *fcxp)
  *
  * @return		void
  */
-void
+static void
 bfa_fcxp_free(struct bfa_fcxp_s *fcxp)
 {
 	struct bfa_fcxp_mod_s *mod = fcxp->fcxp_mod;
@@ -1983,7 +1991,7 @@ bfa_lps_fdisclogo(struct bfa_lps_s *lps)
 	bfa_sm_send_event(lps, BFA_LPS_SM_LOGOUT);
 }
 
-u8
+static u8
 bfa_lps_get_fwtag(struct bfa_s *bfa, u8 lp_tag)
 {
 	struct bfa_lps_mod_s    *mod = BFA_LPS_MOD(bfa);
@@ -3803,7 +3811,7 @@ bfa_fcport_disable(struct bfa_s *bfa)
 }
 
 /* If PBC is disabled on port, return error */
-bfa_status_t
+static bfa_status_t
 bfa_fcport_is_pbcdisabled(struct bfa_s *bfa)
 {
 	struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
@@ -3865,7 +3873,7 @@ bfa_fcport_cfg_speed(struct bfa_s *bfa, enum bfa_port_speed speed)
 /*
  * Get current speed.
  */
-enum bfa_port_speed
+static enum bfa_port_speed
 bfa_fcport_get_speed(struct bfa_s *bfa)
 {
 	struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
@@ -3933,7 +3941,7 @@ bfa_fcport_get_topology(struct bfa_s *bfa)
 /**
  * Get config topology.
  */
-enum bfa_port_topology
+static enum bfa_port_topology
 bfa_fcport_get_cfg_topology(struct bfa_s *bfa)
 {
 	struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
@@ -4173,7 +4181,7 @@ bfa_fcport_is_dport(struct bfa_s *bfa)
 		BFA_PORT_ST_DPORT);
 }
 
-bfa_boolean_t
+static bfa_boolean_t
 bfa_fcport_is_ddport(struct bfa_s *bfa)
 {
 	struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
@@ -4268,7 +4276,7 @@ bfa_fcport_is_linkup(struct bfa_s *bfa)
 		 fcport->trunk.attr.state == BFA_TRUNK_ONLINE);
 }
 
-bfa_boolean_t
+static bfa_boolean_t
 bfa_fcport_is_qos_enabled(struct bfa_s *bfa)
 {
 	struct bfa_fcport_s *fcport = BFA_FCPORT_MOD(bfa);
@@ -4355,7 +4363,7 @@ bfa_fcport_get_bbcr_attr(struct bfa_s *bfa,
 	return BFA_STATUS_OK;
 }
 
-void
+static void
 bfa_fcport_dportenable(struct bfa_s *bfa)
 {
 	/*
@@ -4365,7 +4373,7 @@ bfa_fcport_dportenable(struct bfa_s *bfa)
 	bfa_port_set_dportenabled(&bfa->modules.port, BFA_TRUE);
 }
 
-void
+static void
 bfa_fcport_dportdisable(struct bfa_s *bfa)
 {
 	/*
@@ -4375,7 +4383,7 @@ bfa_fcport_dportdisable(struct bfa_s *bfa)
 	bfa_port_set_dportenabled(&bfa->modules.port, BFA_FALSE);
 }
 
-void
+static void
 bfa_fcport_ddportenable(struct bfa_s *bfa)
 {
 	/*
@@ -4384,7 +4392,7 @@ bfa_fcport_ddportenable(struct bfa_s *bfa)
 	bfa_sm_send_event(BFA_FCPORT_MOD(bfa), BFA_FCPORT_SM_DDPORTENABLE);
 }
 
-void
+static void
 bfa_fcport_ddportdisable(struct bfa_s *bfa)
 {
 	/*
@@ -5208,7 +5216,7 @@ bfa_rport_speed(struct bfa_rport_s *rport, enum bfa_port_speed speed)
 }
 
 /* Set Rport LUN Mask */
-void
+static void
 bfa_rport_set_lunmask(struct bfa_s *bfa, struct bfa_rport_s *rp)
 {
 	struct bfa_lps_mod_s	*lps_mod = BFA_LPS_MOD(bfa);
diff --git a/drivers/scsi/bfa/bfa_svc.h b/drivers/scsi/bfa/bfa_svc.h
index ea2278bc78a8..69222cc946e4 100644
--- a/drivers/scsi/bfa/bfa_svc.h
+++ b/drivers/scsi/bfa/bfa_svc.h
@@ -533,11 +533,9 @@ bfa_status_t bfa_fcport_enable(struct bfa_s *bfa);
 bfa_status_t bfa_fcport_disable(struct bfa_s *bfa);
 bfa_status_t bfa_fcport_cfg_speed(struct bfa_s *bfa,
 				  enum bfa_port_speed speed);
-enum bfa_port_speed bfa_fcport_get_speed(struct bfa_s *bfa);
 bfa_status_t bfa_fcport_cfg_topology(struct bfa_s *bfa,
 				     enum bfa_port_topology topo);
 enum bfa_port_topology bfa_fcport_get_topology(struct bfa_s *bfa);
-enum bfa_port_topology bfa_fcport_get_cfg_topology(struct bfa_s *bfa);
 bfa_status_t bfa_fcport_cfg_hardalpa(struct bfa_s *bfa, u8 alpa);
 bfa_boolean_t bfa_fcport_get_hardalpa(struct bfa_s *bfa, u8 *alpa);
 u8 bfa_fcport_get_myalpa(struct bfa_s *bfa);
@@ -552,7 +550,6 @@ void bfa_fcport_event_register(struct bfa_s *bfa,
 			enum bfa_port_linkstate event), void *event_cbarg);
 bfa_boolean_t bfa_fcport_is_disabled(struct bfa_s *bfa);
 bfa_boolean_t bfa_fcport_is_dport(struct bfa_s *bfa);
-bfa_boolean_t bfa_fcport_is_ddport(struct bfa_s *bfa);
 bfa_status_t bfa_fcport_set_qos_bw(struct bfa_s *bfa,
 				   struct bfa_qos_bw_s *qos_bw);
 enum bfa_port_speed bfa_fcport_get_ratelim_speed(struct bfa_s *bfa);
@@ -566,11 +563,6 @@ bfa_status_t bfa_fcport_get_stats(struct bfa_s *bfa,
 			struct bfa_cb_pending_q_s *cb);
 bfa_status_t bfa_fcport_clear_stats(struct bfa_s *bfa,
 			struct bfa_cb_pending_q_s *cb);
-bfa_boolean_t bfa_fcport_is_qos_enabled(struct bfa_s *bfa);
-bfa_boolean_t bfa_fcport_is_trunk_enabled(struct bfa_s *bfa);
-void bfa_fcport_dportenable(struct bfa_s *bfa);
-void bfa_fcport_dportdisable(struct bfa_s *bfa);
-bfa_status_t bfa_fcport_is_pbcdisabled(struct bfa_s *bfa);
 void bfa_fcport_cfg_faa(struct bfa_s *bfa, u8 state);
 bfa_status_t bfa_fcport_cfg_bbcr(struct bfa_s *bfa,
 			bfa_boolean_t on_off, u8 bb_scn);
@@ -601,7 +593,6 @@ void bfa_cb_rport_qos_scn_prio(void *rport,
  */
 #define BFA_RPORT_TAG_INVALID	0xffff
 #define BFA_LP_TAG_INVALID	0xff
-void	bfa_rport_set_lunmask(struct bfa_s *bfa, struct bfa_rport_s *rp);
 void	bfa_rport_unset_lunmask(struct bfa_s *bfa, struct bfa_rport_s *rp);
 
 /*
@@ -630,8 +621,6 @@ void bfa_fcxp_discard(struct bfa_fcxp_s *fcxp);
 void *bfa_fcxp_get_reqbuf(struct bfa_fcxp_s *fcxp);
 void *bfa_fcxp_get_rspbuf(struct bfa_fcxp_s *fcxp);
 
-void bfa_fcxp_free(struct bfa_fcxp_s *fcxp);
-
 void bfa_fcxp_send(struct bfa_fcxp_s *fcxp, struct bfa_rport_s *rport,
 		   u16 vf_id, u8 lp_tag,
 		   bfa_boolean_t cts, enum fc_cos cos,
@@ -677,7 +666,6 @@ void bfa_lps_fdisc(struct bfa_lps_s *lps, void *uarg, u16 pdusz,
 		   wwn_t pwwn, wwn_t nwwn);
 void bfa_lps_fdisclogo(struct bfa_lps_s *lps);
 void bfa_lps_set_n2n_pid(struct bfa_lps_s *lps, u32 n2n_pid);
-u8 bfa_lps_get_fwtag(struct bfa_s *bfa, u8 lp_tag);
 u32 bfa_lps_get_base_pid(struct bfa_s *bfa);
 u8 bfa_lps_get_tag_from_pid(struct bfa_s *bfa, u32 pid);
 void bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status);
diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index 9d253cb83ee7..9b010b999825 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -38,27 +38,27 @@
 
 BFA_TRC_FILE(LDRV, BFAD);
 DEFINE_MUTEX(bfad_mutex);
-LIST_HEAD(bfad_list);
+static LIST_HEAD(bfad_list);
 
-static int	bfad_inst;
+int	bfad_inst;
 static int      num_sgpgs_parm;
 int		supported_fc4s;
-char		*host_name, *os_name, *os_patch;
-int		num_rports, num_ios, num_tms;
-int		num_fcxps, num_ufbufs;
-int		reqq_size, rspq_size, num_sgpgs;
-int		rport_del_timeout = BFA_FCS_RPORT_DEF_DEL_TIMEOUT;
+static char	*host_name, *os_name, *os_patch;
+static int	num_rports, num_ios, num_tms;
+static int	num_fcxps, num_ufbufs;
+static int	reqq_size, rspq_size, num_sgpgs;
+static int	rport_del_timeout = BFA_FCS_RPORT_DEF_DEL_TIMEOUT;
 int		bfa_lun_queue_depth = BFAD_LUN_QUEUE_DEPTH;
-int		bfa_io_max_sge = BFAD_IO_MAX_SGE;
+static int	bfa_io_max_sge = BFAD_IO_MAX_SGE;
 int		bfa_log_level = 3; /* WARNING log level */
-int		ioc_auto_recover = BFA_TRUE;
+static int	ioc_auto_recover = BFA_TRUE;
 int		bfa_linkup_delay = -1;
-int		fdmi_enable = BFA_TRUE;
-int		pcie_max_read_reqsz;
+static int	fdmi_enable = BFA_TRUE;
+static int	pcie_max_read_reqsz;
 int		bfa_debugfs_enable = 1;
-int		msix_disable_cb = 0, msix_disable_ct = 0;
+static int	msix_disable_cb = 0, msix_disable_ct = 0;
 int		max_xfer_size = BFAD_MAX_SECTORS >> 1;
-int		max_rport_logins = BFA_FCS_MAX_RPORT_LOGINS;
+static int	max_rport_logins = BFA_FCS_MAX_RPORT_LOGINS;
 
 /* Firmware releated */
 u32	bfi_image_cb_size, bfi_image_ct_size, bfi_image_ct2_size;
@@ -164,6 +164,19 @@ bfad_sm_failed(struct bfad_s *bfad, enum bfad_sm_event event);
 static void
 bfad_sm_fcs_exit(struct bfad_s *bfad, enum bfad_sm_event event);
 
+static bfa_status_t
+bfad_cfg_pport(struct bfad_s *bfad, enum bfa_lport_role role);
+static bfa_status_t bfad_start_ops(struct bfad_s *bfad);
+
+static void bfad_fcs_stop(struct bfad_s *bfad);
+static void bfad_init_timer(struct bfad_s *bfad);
+static int  bfad_install_msix_handler(struct bfad_s *bfad);
+static void bfad_stop(struct bfad_s *bfad);
+static void bfad_uncfg_pport(struct bfad_s *bfad);
+static int  bfad_worker(void *ptr);
+static int  bfad_setup_intr(struct bfad_s *bfad);
+static void bfad_remove_intr(struct bfad_s *bfad);
+
 /*
  * Beginning state for the driver instance, awaiting the pci_probe event
  */
@@ -527,7 +540,7 @@ bfa_fcb_pbc_vport_create(struct bfad_s *bfad, struct bfi_pbc_vport_s pbc_vport)
 	list_add_tail(&vport->list_entry, &bfad->pbc_vport_list);
 }
 
-void
+static void
 bfad_hal_mem_release(struct bfad_s *bfad)
 {
 	struct bfa_meminfo_s *hal_meminfo = &bfad->meminfo;
@@ -555,7 +568,7 @@ bfad_hal_mem_release(struct bfad_s *bfad)
 	memset(hal_meminfo, 0, sizeof(struct bfa_meminfo_s));
 }
 
-void
+static void
 bfad_update_hal_cfg(struct bfa_iocfc_cfg_s *bfa_cfg)
 {
 	if (num_rports > 0)
@@ -589,7 +602,7 @@ bfad_update_hal_cfg(struct bfa_iocfc_cfg_s *bfa_cfg)
 	num_sgpgs = bfa_cfg->drvcfg.num_sgpgs;
 }
 
-bfa_status_t
+static bfa_status_t
 bfad_hal_mem_alloc(struct bfad_s *bfad)
 {
 	struct bfa_meminfo_s *hal_meminfo = &bfad->meminfo;
@@ -691,7 +704,7 @@ ext:
 	return rc;
 }
 
-void
+static void
 bfad_bfa_tmo(unsigned long data)
 {
 	struct bfad_s	      *bfad = (struct bfad_s *) data;
@@ -716,7 +729,7 @@ bfad_bfa_tmo(unsigned long data)
 		  jiffies + msecs_to_jiffies(BFA_TIMER_FREQ));
 }
 
-void
+static void
 bfad_init_timer(struct bfad_s *bfad)
 {
 	init_timer(&bfad->hal_tmo);
@@ -727,7 +740,7 @@ bfad_init_timer(struct bfad_s *bfad)
 		  jiffies + msecs_to_jiffies(BFA_TIMER_FREQ));
 }
 
-int
+static int
 bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad)
 {
 	int		rc = -ENODEV;
@@ -808,7 +821,7 @@ out:
 	return rc;
 }
 
-void
+static void
 bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad)
 {
 	pci_iounmap(pdev, bfad->pci_bar0_kva);
@@ -819,7 +832,7 @@ bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad)
 	pci_disable_device(pdev);
 }
 
-bfa_status_t
+static bfa_status_t
 bfad_drv_init(struct bfad_s *bfad)
 {
 	bfa_status_t	rc;
@@ -880,7 +893,7 @@ bfad_drv_uninit(struct bfad_s *bfad)
 	bfad->bfad_flags &= ~BFAD_DRV_INIT_DONE;
 }
 
-void
+static void
 bfad_drv_start(struct bfad_s *bfad)
 {
 	unsigned long	flags;
@@ -896,7 +909,7 @@ bfad_drv_start(struct bfad_s *bfad)
 		flush_workqueue(bfad->im->drv_workq);
 }
 
-void
+static void
 bfad_fcs_stop(struct bfad_s *bfad)
 {
 	unsigned long	flags;
@@ -911,7 +924,7 @@ bfad_fcs_stop(struct bfad_s *bfad)
 	bfa_sm_send_event(bfad, BFAD_E_FCS_EXIT_COMP);
 }
 
-void
+static void
 bfad_stop(struct bfad_s *bfad)
 {
 	unsigned long	flags;
@@ -926,7 +939,7 @@ bfad_stop(struct bfad_s *bfad)
 	bfa_sm_send_event(bfad, BFAD_E_EXIT_COMP);
 }
 
-bfa_status_t
+static bfa_status_t
 bfad_cfg_pport(struct bfad_s *bfad, enum bfa_lport_role role)
 {
 	int		rc = BFA_STATUS_OK;
@@ -953,7 +966,7 @@ out:
 	return rc;
 }
 
-void
+static void
 bfad_uncfg_pport(struct bfad_s *bfad)
 {
 	if ((supported_fc4s & BFA_LPORT_ROLE_FCP_IM) &&
@@ -967,8 +980,9 @@ bfad_uncfg_pport(struct bfad_s *bfad)
 	bfad->bfad_flags &= ~BFAD_CFG_PPORT_DONE;
 }
 
-bfa_status_t
-bfad_start_ops(struct bfad_s *bfad) {
+static bfa_status_t
+bfad_start_ops(struct bfad_s *bfad)
+{
 
 	int	retval;
 	unsigned long	flags;
@@ -1072,7 +1086,7 @@ bfad_start_ops(struct bfad_s *bfad) {
 	return BFA_STATUS_OK;
 }
 
-int
+static int
 bfad_worker(void *ptr)
 {
 	struct bfad_s *bfad = ptr;
@@ -1094,7 +1108,7 @@ bfad_worker(void *ptr)
 /*
  *  BFA driver interrupt functions
  */
-irqreturn_t
+static irqreturn_t
 bfad_intx(int irq, void *dev_id)
 {
 	struct bfad_s	*bfad = dev_id;
@@ -1172,7 +1186,7 @@ bfad_init_msix_entry(struct bfad_s *bfad, struct msix_entry *msix_entries,
 
 }
 
-int
+static int
 bfad_install_msix_handler(struct bfad_s *bfad)
 {
 	int i, error = 0;
@@ -1208,7 +1222,7 @@ bfad_install_msix_handler(struct bfad_s *bfad)
 /*
  * Setup MSIX based interrupt.
  */
-int
+static int
 bfad_setup_intr(struct bfad_s *bfad)
 {
 	int error;
@@ -1277,7 +1291,7 @@ line_based:
 	return 0;
 }
 
-void
+static void
 bfad_remove_intr(struct bfad_s *bfad)
 {
 	int	i;
@@ -1297,7 +1311,7 @@ bfad_remove_intr(struct bfad_s *bfad)
 /*
  * PCI probe entry.
  */
-int
+static int
 bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid)
 {
 	struct bfad_s	*bfad;
@@ -1398,7 +1412,7 @@ out:
 /*
  * PCI remove entry.
  */
-void
+static void
 bfad_pci_remove(struct pci_dev *pdev)
 {
 	struct bfad_s	      *bfad = pci_get_drvdata(pdev);
@@ -1498,7 +1512,7 @@ bfad_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
 	return ret;
 }
 
-int
+static int
 restart_bfa(struct bfad_s *bfad)
 {
 	unsigned long flags;
@@ -1629,7 +1643,7 @@ bfad_pci_resume(struct pci_dev *pdev)
 	spin_unlock_irqrestore(&bfad->bfad_lock, flags);
 }
 
-struct pci_device_id bfad_id_table[] = {
+static struct pci_device_id bfad_id_table[] = {
 	{
 		.vendor = BFA_PCI_VENDOR_ID_BROCADE,
 		.device = BFA_PCI_DEVICE_ID_FC_8G2P,
diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c
index 13db3b7bc873..3668b02168f9 100644
--- a/drivers/scsi/bfa/bfad_attr.c
+++ b/drivers/scsi/bfa/bfad_attr.c
@@ -443,7 +443,7 @@ bfad_im_vport_create(struct fc_vport *fc_vport, bool disable)
 	return status;
 }
 
-int
+static int
 bfad_im_issue_fc_host_lip(struct Scsi_Host *shost)
 {
 	struct bfad_im_port_s *im_port =
@@ -571,7 +571,7 @@ bfad_im_vport_disable(struct fc_vport *fc_vport, bool disable)
 	return 0;
 }
 
-void
+static void
 bfad_im_vport_set_symbolic_name(struct fc_vport *fc_vport)
 {
 	struct bfad_vport_s *vport = (struct bfad_vport_s *)fc_vport->dd_data;
diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c
index d1ad0208dfe7..44cf38b9c2a5 100644
--- a/drivers/scsi/bfa/bfad_bsg.c
+++ b/drivers/scsi/bfa/bfad_bsg.c
@@ -23,7 +23,7 @@
 
 BFA_TRC_FILE(LDRV, BSG);
 
-int
+static int
 bfad_iocmd_ioc_enable(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -46,7 +46,7 @@ bfad_iocmd_ioc_enable(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ioc_disable(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -144,7 +144,7 @@ bfad_iocmd_ioc_get_attr(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ioc_get_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_ioc_stats_s *iocmd = (struct bfa_bsg_ioc_stats_s *)cmd;
@@ -154,7 +154,7 @@ bfad_iocmd_ioc_get_stats(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ioc_get_fwstats(struct bfad_s *bfad, void *cmd,
 			unsigned int payload_len)
 {
@@ -184,7 +184,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ioc_reset_stats(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -202,7 +202,7 @@ bfad_iocmd_ioc_reset_stats(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ioc_set_name(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_ioc_name_s *iocmd = (struct bfa_bsg_ioc_name_s *) cmd;
@@ -216,7 +216,7 @@ bfad_iocmd_ioc_set_name(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_iocfc_get_attr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_iocfc_attr_s *iocmd = (struct bfa_bsg_iocfc_attr_s *)cmd;
@@ -227,7 +227,7 @@ bfad_iocmd_iocfc_get_attr(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ioc_fw_sig_inv(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -239,7 +239,7 @@ bfad_iocmd_ioc_fw_sig_inv(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_iocfc_set_intr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_iocfc_intr_s *iocmd = (struct bfa_bsg_iocfc_intr_s *)cmd;
@@ -252,7 +252,7 @@ bfad_iocmd_iocfc_set_intr(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_port_enable(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -273,7 +273,7 @@ bfad_iocmd_port_enable(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_port_disable(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -323,7 +323,7 @@ bfad_iocmd_port_get_attr(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_port_get_stats(struct bfad_s *bfad, void *cmd,
 			unsigned int payload_len)
 {
@@ -357,7 +357,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_port_reset_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -378,7 +378,7 @@ bfad_iocmd_port_reset_stats(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_set_port_cfg(struct bfad_s *bfad, void *iocmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_port_cfg_s *cmd = (struct bfa_bsg_port_cfg_s *)iocmd;
@@ -398,7 +398,7 @@ bfad_iocmd_set_port_cfg(struct bfad_s *bfad, void *iocmd, unsigned int v_cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_port_cfg_maxfrsize(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_port_cfg_maxfrsize_s *iocmd =
@@ -412,7 +412,7 @@ bfad_iocmd_port_cfg_maxfrsize(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_port_cfg_bbcr(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
 {
 	struct bfa_bsg_bbcr_enable_s *iocmd =
@@ -435,7 +435,7 @@ bfad_iocmd_port_cfg_bbcr(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_port_get_bbcr_attr(struct bfad_s *bfad, void *pcmd)
 {
 	struct bfa_bsg_bbcr_attr_s *iocmd = (struct bfa_bsg_bbcr_attr_s *) pcmd;
@@ -473,7 +473,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_lport_get_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_fcs_lport_s *fcs_port;
@@ -497,7 +497,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_lport_reset_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_fcs_lport_s *fcs_port;
@@ -531,7 +531,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_lport_get_iostats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_fcs_lport_s *fcs_port;
@@ -556,7 +556,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_lport_get_rports(struct bfad_s *bfad, void *cmd,
 			unsigned int payload_len)
 {
@@ -598,7 +598,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_rport_get_attr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_rport_attr_s *iocmd = (struct bfa_bsg_rport_attr_s *)cmd;
@@ -684,7 +684,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_rport_get_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_rport_stats_s *iocmd =
@@ -725,7 +725,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_rport_clr_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_rport_reset_stats_s *iocmd =
@@ -761,7 +761,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_rport_set_speed(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_rport_set_speed_s *iocmd =
@@ -797,7 +797,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_vport_get_attr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_fcs_vport_s *fcs_vport;
@@ -820,7 +820,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_vport_get_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_fcs_vport_s *fcs_vport;
@@ -848,7 +848,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_vport_clr_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_fcs_vport_s *fcs_vport;
@@ -915,7 +915,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_qos_set_bw(struct bfad_s *bfad, void *pcmd)
 {
 	struct bfa_bsg_qos_bw_s *iocmd = (struct bfa_bsg_qos_bw_s *)pcmd;
@@ -928,7 +928,7 @@ bfad_iocmd_qos_set_bw(struct bfad_s *bfad, void *pcmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ratelim(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)pcmd;
@@ -957,7 +957,7 @@ bfad_iocmd_ratelim(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ratelim_speed(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
 {
 	struct bfa_bsg_trl_speed_s *iocmd = (struct bfa_bsg_trl_speed_s *)pcmd;
@@ -986,7 +986,7 @@ bfad_iocmd_ratelim_speed(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_cfg_fcpim(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcpim_s *iocmd = (struct bfa_bsg_fcpim_s *)cmd;
@@ -999,7 +999,7 @@ bfad_iocmd_cfg_fcpim(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcpim_get_modstats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcpim_modstats_s *iocmd =
@@ -1021,7 +1021,7 @@ bfad_iocmd_fcpim_get_modstats(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcpim_clr_modstats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcpim_modstatsclr_s *iocmd =
@@ -1043,7 +1043,7 @@ bfad_iocmd_fcpim_clr_modstats(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcpim_get_del_itn_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcpim_del_itn_stats_s *iocmd =
@@ -1168,7 +1168,7 @@ bfad_iocmd_itnim_get_itnstats(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcport_enable(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -1181,7 +1181,7 @@ bfad_iocmd_fcport_enable(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcport_disable(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -1194,7 +1194,7 @@ bfad_iocmd_fcport_disable(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ioc_get_pcifn_cfg(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_pcifn_cfg_s *iocmd = (struct bfa_bsg_pcifn_cfg_s *)cmd;
@@ -1216,7 +1216,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_pcifn_create(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_pcifn_s *iocmd = (struct bfa_bsg_pcifn_s *)cmd;
@@ -1239,7 +1239,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_pcifn_delete(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_pcifn_s *iocmd = (struct bfa_bsg_pcifn_s *)cmd;
@@ -1261,7 +1261,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_pcifn_bw(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_pcifn_s *iocmd = (struct bfa_bsg_pcifn_s *)cmd;
@@ -1285,7 +1285,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_adapter_cfg_mode(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_adapter_cfg_mode_s *iocmd =
@@ -1308,7 +1308,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_port_cfg_mode(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_port_cfg_mode_s *iocmd =
@@ -1332,7 +1332,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ablk_optrom(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)pcmd;
@@ -1358,7 +1358,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_faa_query(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_faa_attr_s *iocmd = (struct bfa_bsg_faa_attr_s *)cmd;
@@ -1381,7 +1381,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_cee_attr(struct bfad_s *bfad, void *cmd, unsigned int payload_len)
 {
 	struct bfa_bsg_cee_attr_s *iocmd =
@@ -1417,7 +1417,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_cee_get_stats(struct bfad_s *bfad, void *cmd,
 			unsigned int payload_len)
 {
@@ -1454,7 +1454,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_cee_reset_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -1468,7 +1468,7 @@ bfad_iocmd_cee_reset_stats(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_sfp_media(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_sfp_media_s *iocmd = (struct bfa_bsg_sfp_media_s *)cmd;
@@ -1490,7 +1490,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_sfp_speed(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_sfp_speed_s *iocmd = (struct bfa_bsg_sfp_speed_s *)cmd;
@@ -1511,7 +1511,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_flash_get_attr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_flash_attr_s *iocmd =
@@ -1532,7 +1532,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_flash_erase_part(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_flash_s *iocmd = (struct bfa_bsg_flash_s *)cmd;
@@ -1552,7 +1552,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_flash_update_part(struct bfad_s *bfad, void *cmd,
 			unsigned int payload_len)
 {
@@ -1584,7 +1584,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_flash_read_part(struct bfad_s *bfad, void *cmd,
 			unsigned int payload_len)
 {
@@ -1616,7 +1616,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_temp(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_diag_get_temp_s *iocmd =
@@ -1638,7 +1638,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_memtest(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_diag_memtest_s *iocmd =
@@ -1661,7 +1661,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_loopback(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_diag_loopback_s *iocmd =
@@ -1684,7 +1684,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_fwping(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_diag_fwping_s *iocmd =
@@ -1708,7 +1708,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_queuetest(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_diag_qtest_s *iocmd = (struct bfa_bsg_diag_qtest_s *)cmd;
@@ -1729,7 +1729,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_sfp(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_sfp_show_s *iocmd =
@@ -1752,7 +1752,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_led(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_diag_led_s *iocmd = (struct bfa_bsg_diag_led_s *)cmd;
@@ -1765,7 +1765,7 @@ bfad_iocmd_diag_led(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_beacon_lport(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_diag_beacon_s *iocmd =
@@ -1780,7 +1780,7 @@ bfad_iocmd_diag_beacon_lport(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_lb_stat(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_diag_lb_stat_s *iocmd =
@@ -1795,7 +1795,7 @@ bfad_iocmd_diag_lb_stat(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_dport_enable(struct bfad_s *bfad, void *pcmd)
 {
 	struct bfa_bsg_dport_enable_s *iocmd =
@@ -1817,7 +1817,7 @@ bfad_iocmd_diag_dport_enable(struct bfad_s *bfad, void *pcmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_dport_disable(struct bfad_s *bfad, void *pcmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)pcmd;
@@ -1837,7 +1837,7 @@ bfad_iocmd_diag_dport_disable(struct bfad_s *bfad, void *pcmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_dport_start(struct bfad_s *bfad, void *pcmd)
 {
 	struct bfa_bsg_dport_enable_s *iocmd =
@@ -1862,7 +1862,7 @@ bfad_iocmd_diag_dport_start(struct bfad_s *bfad, void *pcmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_diag_dport_show(struct bfad_s *bfad, void *pcmd)
 {
 	struct bfa_bsg_diag_dport_show_s *iocmd =
@@ -1877,7 +1877,7 @@ bfad_iocmd_diag_dport_show(struct bfad_s *bfad, void *pcmd)
 }
 
 
-int
+static int
 bfad_iocmd_phy_get_attr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_phy_attr_s *iocmd =
@@ -1898,7 +1898,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_phy_get_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_phy_stats_s *iocmd =
@@ -1919,7 +1919,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_phy_read(struct bfad_s *bfad, void *cmd, unsigned int payload_len)
 {
 	struct bfa_bsg_phy_s *iocmd = (struct bfa_bsg_phy_s *)cmd;
@@ -1951,7 +1951,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_vhba_query(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_vhba_attr_s *iocmd =
@@ -1970,7 +1970,7 @@ bfad_iocmd_vhba_query(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_phy_update(struct bfad_s *bfad, void *cmd, unsigned int payload_len)
 {
 	struct bfa_bsg_phy_s *iocmd = (struct bfa_bsg_phy_s *)cmd;
@@ -2000,7 +2000,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_porglog_get(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_debug_s *iocmd = (struct bfa_bsg_debug_s *)cmd;
@@ -2020,7 +2020,7 @@ out:
 }
 
 #define BFA_DEBUG_FW_CORE_CHUNK_SZ	0x4000U /* 16K chunks for FW dump */
-int
+static int
 bfad_iocmd_debug_fw_core(struct bfad_s *bfad, void *cmd,
 			unsigned int payload_len)
 {
@@ -2054,7 +2054,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_debug_ctl(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -2075,7 +2075,7 @@ bfad_iocmd_debug_ctl(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_porglog_ctl(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_portlogctl_s *iocmd = (struct bfa_bsg_portlogctl_s *)cmd;
@@ -2089,7 +2089,7 @@ bfad_iocmd_porglog_ctl(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcpim_cfg_profile(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_fcpim_profile_s *iocmd =
@@ -2135,7 +2135,7 @@ bfad_iocmd_itnim_get_ioprofile(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcport_get_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcport_stats_s *iocmd =
@@ -2160,7 +2160,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcport_reset_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -2184,7 +2184,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_boot_cfg(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_boot_s *iocmd = (struct bfa_bsg_boot_s *)cmd;
@@ -2206,7 +2206,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_boot_query(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_boot_s *iocmd = (struct bfa_bsg_boot_s *)cmd;
@@ -2228,7 +2228,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_preboot_query(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_preboot_s *iocmd = (struct bfa_bsg_preboot_s *)cmd;
@@ -2247,7 +2247,7 @@ bfad_iocmd_preboot_query(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ethboot_cfg(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_ethboot_s *iocmd = (struct bfa_bsg_ethboot_s *)cmd;
@@ -2270,7 +2270,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_ethboot_query(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_ethboot_s *iocmd = (struct bfa_bsg_ethboot_s *)cmd;
@@ -2293,7 +2293,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_cfg_trunk(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -2333,7 +2333,7 @@ bfad_iocmd_cfg_trunk(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_trunk_get_attr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_trunk_attr_s *iocmd = (struct bfa_bsg_trunk_attr_s *)cmd;
@@ -2356,7 +2356,7 @@ bfad_iocmd_trunk_get_attr(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_qos(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -2384,7 +2384,7 @@ bfad_iocmd_qos(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_qos_get_attr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_qos_attr_s *iocmd = (struct bfa_bsg_qos_attr_s *)cmd;
@@ -2410,7 +2410,7 @@ bfad_iocmd_qos_get_attr(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_qos_get_vc_attr(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_qos_vc_attr_s *iocmd =
@@ -2442,7 +2442,7 @@ bfad_iocmd_qos_get_vc_attr(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_qos_get_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcport_stats_s *iocmd =
@@ -2474,7 +2474,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_qos_reset_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -2505,7 +2505,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_vf_get_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_vf_stats_s *iocmd =
@@ -2528,7 +2528,7 @@ out:
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_vf_clr_stats(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_vf_reset_stats_s *iocmd =
@@ -2565,7 +2565,7 @@ bfad_iocmd_lunmask_reset_lunscan_mode(struct bfad_s *bfad, int lunmask_cfg)
 		bfad_reset_sdev_bflags(vport->drv_port.im_port, lunmask_cfg);
 }
 
-int
+static int
 bfad_iocmd_lunmask(struct bfad_s *bfad, void *pcmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)pcmd;
@@ -2588,7 +2588,7 @@ bfad_iocmd_lunmask(struct bfad_s *bfad, void *pcmd, unsigned int v_cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcpim_lunmask_query(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcpim_lunmask_query_s *iocmd =
@@ -2602,7 +2602,7 @@ bfad_iocmd_fcpim_lunmask_query(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcpim_cfg_lunmask(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 {
 	struct bfa_bsg_fcpim_lunmask_s *iocmd =
@@ -2621,7 +2621,7 @@ bfad_iocmd_fcpim_cfg_lunmask(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcpim_throttle_query(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcpim_throttle_s *iocmd =
@@ -2636,7 +2636,7 @@ bfad_iocmd_fcpim_throttle_query(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fcpim_throttle_set(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fcpim_throttle_s *iocmd =
@@ -2651,7 +2651,7 @@ bfad_iocmd_fcpim_throttle_set(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_tfru_read(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_tfru_s *iocmd =
@@ -2673,7 +2673,7 @@ bfad_iocmd_tfru_read(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_tfru_write(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_tfru_s *iocmd =
@@ -2695,7 +2695,7 @@ bfad_iocmd_tfru_write(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fruvpd_read(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fruvpd_s *iocmd =
@@ -2717,7 +2717,7 @@ bfad_iocmd_fruvpd_read(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fruvpd_update(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fruvpd_s *iocmd =
@@ -2739,7 +2739,7 @@ bfad_iocmd_fruvpd_update(struct bfad_s *bfad, void *cmd)
 	return 0;
 }
 
-int
+static int
 bfad_iocmd_fruvpd_get_max_size(struct bfad_s *bfad, void *cmd)
 {
 	struct bfa_bsg_fruvpd_max_size_s *iocmd =
@@ -3191,7 +3191,7 @@ out:
 }
 
 /* FC passthru call backs */
-u64
+static u64
 bfad_fcxp_get_req_sgaddr_cb(void *bfad_fcxp, int sgeid)
 {
 	struct bfad_fcxp	*drv_fcxp = bfad_fcxp;
@@ -3203,7 +3203,7 @@ bfad_fcxp_get_req_sgaddr_cb(void *bfad_fcxp, int sgeid)
 	return addr;
 }
 
-u32
+static u32
 bfad_fcxp_get_req_sglen_cb(void *bfad_fcxp, int sgeid)
 {
 	struct bfad_fcxp	*drv_fcxp = bfad_fcxp;
@@ -3213,7 +3213,7 @@ bfad_fcxp_get_req_sglen_cb(void *bfad_fcxp, int sgeid)
 	return sge->sg_len;
 }
 
-u64
+static u64
 bfad_fcxp_get_rsp_sgaddr_cb(void *bfad_fcxp, int sgeid)
 {
 	struct bfad_fcxp	*drv_fcxp = bfad_fcxp;
@@ -3225,7 +3225,7 @@ bfad_fcxp_get_rsp_sgaddr_cb(void *bfad_fcxp, int sgeid)
 	return addr;
 }
 
-u32
+static u32
 bfad_fcxp_get_rsp_sglen_cb(void *bfad_fcxp, int sgeid)
 {
 	struct bfad_fcxp	*drv_fcxp = bfad_fcxp;
@@ -3235,7 +3235,7 @@ bfad_fcxp_get_rsp_sglen_cb(void *bfad_fcxp, int sgeid)
 	return sge->sg_len;
 }
 
-void
+static void
 bfad_send_fcpt_cb(void *bfad_fcxp, struct bfa_fcxp_s *fcxp, void *cbarg,
 		bfa_status_t req_status, u32 rsp_len, u32 resid_len,
 		struct fchs_s *rsp_fchs)
@@ -3250,7 +3250,7 @@ bfad_send_fcpt_cb(void *bfad_fcxp, struct bfa_fcxp_s *fcxp, void *cbarg,
 	complete(&drv_fcxp->comp);
 }
 
-struct bfad_buf_info *
+static struct bfad_buf_info *
 bfad_fcxp_map_sg(struct bfad_s *bfad, void *payload_kbuf,
 		 uint32_t payload_len, uint32_t *num_sgles)
 {
@@ -3293,7 +3293,7 @@ out_free_mem:
 	return NULL;
 }
 
-void
+static void
 bfad_fcxp_free_mem(struct bfad_s *bfad, struct bfad_buf_info *buf_base,
 		   uint32_t num_sgles)
 {
@@ -3311,7 +3311,7 @@ bfad_fcxp_free_mem(struct bfad_s *bfad, struct bfad_buf_info *buf_base,
 	}
 }
 
-int
+static int
 bfad_fcxp_bsg_send(struct fc_bsg_job *job, struct bfad_fcxp *drv_fcxp,
 		   bfa_bsg_fcpt_t *bsg_fcpt)
 {
@@ -3351,7 +3351,7 @@ bfad_fcxp_bsg_send(struct fc_bsg_job *job, struct bfad_fcxp *drv_fcxp,
 	return BFA_STATUS_OK;
 }
 
-int
+static int
 bfad_im_bsg_els_ct_request(struct fc_bsg_job *job)
 {
 	struct bfa_bsg_data *bsg_data;
diff --git a/drivers/scsi/bfa/bfad_drv.h b/drivers/scsi/bfa/bfad_drv.h
index f9e862093a25..b70870411af6 100644
--- a/drivers/scsi/bfa/bfad_drv.h
+++ b/drivers/scsi/bfa/bfad_drv.h
@@ -299,61 +299,19 @@ bfa_status_t	bfad_vport_create(struct bfad_s *bfad, u16 vf_id,
 				  struct device *dev);
 bfa_status_t	bfad_vf_create(struct bfad_s *bfad, u16 vf_id,
 			       struct bfa_lport_cfg_s *port_cfg);
-bfa_status_t	bfad_cfg_pport(struct bfad_s *bfad, enum bfa_lport_role role);
-bfa_status_t	bfad_drv_init(struct bfad_s *bfad);
-bfa_status_t	bfad_start_ops(struct bfad_s *bfad);
-void		bfad_drv_start(struct bfad_s *bfad);
-void		bfad_uncfg_pport(struct bfad_s *bfad);
-void		bfad_stop(struct bfad_s *bfad);
-void		bfad_fcs_stop(struct bfad_s *bfad);
-void		bfad_remove_intr(struct bfad_s *bfad);
-void		bfad_hal_mem_release(struct bfad_s *bfad);
 void		bfad_hcb_comp(void *arg, bfa_status_t status);
 
-int		bfad_setup_intr(struct bfad_s *bfad);
-void		bfad_remove_intr(struct bfad_s *bfad);
-void		bfad_update_hal_cfg(struct bfa_iocfc_cfg_s *bfa_cfg);
-bfa_status_t	bfad_hal_mem_alloc(struct bfad_s *bfad);
-void		bfad_bfa_tmo(unsigned long data);
-void		bfad_init_timer(struct bfad_s *bfad);
-int		bfad_pci_init(struct pci_dev *pdev, struct bfad_s *bfad);
-void		bfad_pci_uninit(struct pci_dev *pdev, struct bfad_s *bfad);
 void		bfad_drv_uninit(struct bfad_s *bfad);
-int		bfad_worker(void *ptr);
 void		bfad_debugfs_init(struct bfad_port_s *port);
 void		bfad_debugfs_exit(struct bfad_port_s *port);
 
-void bfad_pci_remove(struct pci_dev *pdev);
-int bfad_pci_probe(struct pci_dev *pdev, const struct pci_device_id *pid);
 void bfad_rport_online_wait(struct bfad_s *bfad);
 int bfad_get_linkup_delay(struct bfad_s *bfad);
-int bfad_install_msix_handler(struct bfad_s *bfad);
-
-extern struct idr bfad_im_port_index;
-extern struct pci_device_id bfad_id_table[];
-extern struct list_head bfad_list;
-extern char	*os_name;
-extern char	*os_patch;
-extern char	*host_name;
-extern int	num_rports;
-extern int	num_ios;
-extern int	num_tms;
-extern int	num_fcxps;
-extern int	num_ufbufs;
-extern int	reqq_size;
-extern int	rspq_size;
-extern int	num_sgpgs;
-extern int      rport_del_timeout;
+
 extern int      bfa_lun_queue_depth;
-extern int      bfa_io_max_sge;
 extern int      bfa_log_level;
-extern int      ioc_auto_recover;
 extern int      bfa_linkup_delay;
-extern int      msix_disable_cb;
-extern int      msix_disable_ct;
-extern int      fdmi_enable;
 extern int      supported_fc4s;
-extern int	pcie_max_read_reqsz;
 extern int	max_xfer_size;
 extern int bfa_debugfs_enable;
 extern struct mutex bfad_mutex;
diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c
index 02d806012fa1..f56a22a640ea 100644
--- a/drivers/scsi/bfa/bfad_im.c
+++ b/drivers/scsi/bfa/bfad_im.c
@@ -28,7 +28,8 @@
 
 BFA_TRC_FILE(LDRV, IM);
 
-DEFINE_IDR(bfad_im_port_index);
+static DEFINE_IDR(bfad_im_port_index);
+static struct scsi_host_template bfad_im_vport_template;
 struct scsi_transport_template *bfad_im_scsi_transport_template;
 struct scsi_transport_template *bfad_im_scsi_vport_transport_template;
 static void bfad_im_itnim_work_handler(struct work_struct *work);
@@ -36,6 +37,14 @@ static int bfad_im_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmnd);
 static int bfad_im_slave_alloc(struct scsi_device *sdev);
 static void bfad_im_fc_rport_add(struct bfad_im_port_s  *im_port,
 				struct bfad_itnim_s *itnim);
+static void bfad_destroy_workq(struct bfad_im_s *im);
+static void bfad_handle_qfull(struct bfad_itnim_s *itnim,
+			      struct scsi_device *sdev);
+static struct Scsi_Host * bfad_scsi_host_alloc(struct bfad_im_port_s *im_port,
+					       struct bfad_s *bfad);
+static bfa_status_t bfad_thread_workq(struct bfad_s *bfad);
+static void bfad_ramp_up_qdepth(struct bfad_itnim_s *itnim,
+				struct scsi_device *sdev);
 
 void
 bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio,
@@ -740,7 +749,7 @@ bfad_im_probe_undo(struct bfad_s *bfad)
 	}
 }
 
-struct Scsi_Host *
+static struct Scsi_Host *
 bfad_scsi_host_alloc(struct bfad_im_port_s *im_port, struct bfad_s *bfad)
 {
 	struct scsi_host_template *sht;
@@ -768,7 +777,7 @@ bfad_scsi_host_free(struct bfad_s *bfad, struct bfad_im_port_s *im_port)
 	kfree(im_port);
 }
 
-void
+static void
 bfad_destroy_workq(struct bfad_im_s *im)
 {
 	if (im && im->drv_workq) {
@@ -778,7 +787,7 @@ bfad_destroy_workq(struct bfad_im_s *im)
 	}
 }
 
-bfa_status_t
+static bfa_status_t
 bfad_thread_workq(struct bfad_s *bfad)
 {
 	struct bfad_im_s      *im = bfad->im;
@@ -830,7 +839,7 @@ struct scsi_host_template bfad_im_scsi_host_template = {
 	.vendor_id = BFA_PCI_VENDOR_ID_BROCADE,
 };
 
-struct scsi_host_template bfad_im_vport_template = {
+static struct scsi_host_template bfad_im_vport_template = {
 	.module = THIS_MODULE,
 	.name = BFAD_DRIVER_NAME,
 	.info = bfad_im_info,
@@ -881,7 +890,7 @@ bfad_im_module_exit(void)
 	idr_destroy(&bfad_im_port_index);
 }
 
-void
+static void
 bfad_ramp_up_qdepth(struct bfad_itnim_s *itnim, struct scsi_device *sdev)
 {
 	struct scsi_device *tmp_sdev;
@@ -903,7 +912,7 @@ bfad_ramp_up_qdepth(struct bfad_itnim_s *itnim, struct scsi_device *sdev)
 	}
 }
 
-void
+static void
 bfad_handle_qfull(struct bfad_itnim_s *itnim, struct scsi_device *sdev)
 {
 	struct scsi_device *tmp_sdev;
diff --git a/drivers/scsi/bfa/bfad_im.h b/drivers/scsi/bfa/bfad_im.h
index 836fdc221edd..10761786287a 100644
--- a/drivers/scsi/bfa/bfad_im.h
+++ b/drivers/scsi/bfa/bfad_im.h
@@ -142,20 +142,12 @@ struct bfad_im_s {
 			   &(_drv)->im->aen_im_notify_work);		      \
 } while (0)
 
-struct Scsi_Host *bfad_scsi_host_alloc(struct bfad_im_port_s *im_port,
-				struct bfad_s *);
-bfa_status_t bfad_thread_workq(struct bfad_s *bfad);
-void bfad_destroy_workq(struct bfad_im_s *im);
 void bfad_fc_host_init(struct bfad_im_port_s *im_port);
 void bfad_scsi_host_free(struct bfad_s *bfad,
 				 struct bfad_im_port_s *im_port);
-void bfad_ramp_up_qdepth(struct bfad_itnim_s *itnim,
-				 struct scsi_device *sdev);
-void bfad_handle_qfull(struct bfad_itnim_s *itnim, struct scsi_device *sdev);
 struct bfad_itnim_s *bfad_get_itnim(struct bfad_im_port_s *im_port, int id);
 
 extern struct scsi_host_template bfad_im_scsi_host_template;
-extern struct scsi_host_template bfad_im_vport_template;
 extern struct fc_function_template bfad_im_fc_function_template;
 extern struct fc_function_template bfad_im_vport_fc_function_template;
 extern struct scsi_transport_template *bfad_im_scsi_transport_template;
@@ -164,8 +156,6 @@ extern struct scsi_transport_template *bfad_im_scsi_vport_transport_template;
 extern struct device_attribute *bfad_im_host_attrs[];
 extern struct device_attribute *bfad_im_vport_attrs[];
 
-irqreturn_t bfad_intx(int irq, void *dev_id);
-
 int bfad_im_bsg_request(struct fc_bsg_job *job);
 int bfad_im_bsg_timeout(struct fc_bsg_job *job);
 
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* RE: [PATCH 0/5] bfa: fix W=1 build warnings
  2016-08-02 15:22 [PATCH 0/5] bfa: fix W=1 build warnings Arnd Bergmann
                   ` (4 preceding siblings ...)
  2016-08-02 15:22 ` [PATCH 5/5] bfa: remove more unused functions Arnd Bergmann
@ 2016-08-10  5:28 ` Sudarsana Kalluru
  5 siblings, 0 replies; 11+ messages in thread
From: Sudarsana Kalluru @ 2016-08-10  5:28 UTC (permalink / raw)
  To: Arnd Bergmann, Anil Gurumurthy
  Cc: James E . J . Bottomley, Martin K . Petersen, linux-scsi,
	linux-kernel, Baoyou Xie

Hi,
    Thanks for the patches. Changes look fine to me, other than a minor change in patch-1 and the build issue due to the removal of bfa_isr_disable()declaration.

Thanks,
Sudarsana

-----Original Message-----
From: Arnd Bergmann [mailto:arnd@arndb.de] 
Sent: 02 August 2016 20:53
To: Anil Gurumurthy <Anil.Gurumurthy@qlogic.com>; Sudarsana Kalluru <Sudarsana.Kalluru@qlogic.com>
Cc: James E . J . Bottomley <jejb@linux.vnet.ibm.com>; Martin K . Petersen <martin.petersen@oracle.com>; linux-scsi <linux-scsi@vger.kernel.org>; linux-kernel <linux-kernel@vger.kernel.org>; Baoyou Xie <baoyou.xie@linaro.org>; Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 0/5] bfa: fix W=1 build warnings

I tried to build an allmodconfig kernel with W=1, and the bfa driver stuck out for having the most warnings in one file, so I decided to send patches for all of these and make the driver build cleanly with the extra warnings enabled.

As most warnings were for functions that lacked a 'static', I marked them that way, and also used a script to look for further functions that have a declaration but can also be static.

Overall, this saves around 10% of the size of the driver
module:

   text	   data	    bss	    dec	    hex	filename
 232027	   3012	    976	 236015	  399ef	drivers/scsi/bfa/bfa-before.o
 221851	   2996	    908	 225755	  371db	drivers/scsi/bfa/bfa-after.o

	Arnd

Arnd Bergmann (5):
  bfa: mark symbols static where possible
  bfa: remove unused variables
  bfa: rename some global variables
  bfa: remove unused functions from fbbuild.c
  bfa: remove more unused functions

 drivers/scsi/bfa/bfa.h           |  17 --
 drivers/scsi/bfa/bfa_core.c      |  54 +---
 drivers/scsi/bfa/bfa_fcbuild.c   | 609 +--------------------------------------
 drivers/scsi/bfa/bfa_fcbuild.h   |  90 ------
 drivers/scsi/bfa/bfa_fcpim.c     |  81 +++---
 drivers/scsi/bfa/bfa_fcpim.h     |  26 --
 drivers/scsi/bfa/bfa_fcs.c       |  31 +-
 drivers/scsi/bfa/bfa_fcs.h       |  54 ----
 drivers/scsi/bfa/bfa_fcs_lport.c | 211 +++-----------  drivers/scsi/bfa/bfa_fcs_rport.c |  48 +--
 drivers/scsi/bfa/bfa_ioc.c       |  83 ++----
 drivers/scsi/bfa/bfa_ioc.h       |  25 --
 drivers/scsi/bfa/bfa_ioc_cb.c    |   3 +-
 drivers/scsi/bfa/bfa_ioc_ct.c    |  12 +-
 drivers/scsi/bfa/bfa_plog.h      |   8 -
 drivers/scsi/bfa/bfa_port.c      |   6 +-
 drivers/scsi/bfa/bfa_port.h      |   1 -
 drivers/scsi/bfa/bfa_svc.c       |  95 ++----
 drivers/scsi/bfa/bfa_svc.h       |  17 --
 drivers/scsi/bfa/bfad.c          | 128 ++++----
 drivers/scsi/bfa/bfad_attr.c     |   9 +-
 drivers/scsi/bfa/bfad_bsg.c      | 224 +++++++-------
 drivers/scsi/bfa/bfad_drv.h      |  49 +---
 drivers/scsi/bfa/bfad_im.c       |  29 +-
 drivers/scsi/bfa/bfad_im.h       |  10 -
 25 files changed, 395 insertions(+), 1525 deletions(-)

--
2.9.0

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-08-10 21:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 15:22 [PATCH 0/5] bfa: fix W=1 build warnings Arnd Bergmann
2016-08-02 15:22 ` [PATCH 1/5] bfa: mark symbols static where possible Arnd Bergmann
2016-08-03  4:45   ` kbuild test robot
2016-08-03  4:45     ` kbuild test robot
2016-08-03  7:46     ` Arnd Bergmann
2016-08-10  5:20   ` Sudarsana Kalluru
2016-08-02 15:22 ` [PATCH 2/5] bfa: remove unused variables Arnd Bergmann
2016-08-02 15:22 ` [PATCH 3/5] bfa: rename some global variables Arnd Bergmann
2016-08-02 15:22 ` [PATCH 4/5] bfa: remove unused functions from fbbuild.c Arnd Bergmann
2016-08-02 15:22 ` [PATCH 5/5] bfa: remove more unused functions Arnd Bergmann
2016-08-10  5:28 ` [PATCH 0/5] bfa: fix W=1 build warnings Sudarsana Kalluru

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.