bfa: fix W=1 build warnings
Subsystems (2)
cover 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(-)
Signature · 1 line
2.9.0
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.
--- 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(-)
drivers/scsi/bfa/bfa.h +0 -15
@@ -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);
drivers/scsi/bfa/bfa_core.c +12 -7
@@ -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;
drivers/scsi/bfa/bfa_fcbuild.c +1 -1
@@ -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 ));
drivers/scsi/bfa/bfa_fcbuild.h +0 -3
@@ -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,
drivers/scsi/bfa/bfa_fcpim.c +43 -23
232 lines not on this page · raw message
drivers/scsi/bfa/bfa_fcpim.h +0 -25
@@ -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);
drivers/scsi/bfa/bfa_fcs.c +20 -11
@@ -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);
drivers/scsi/bfa/bfa_fcs.h +0 -41
89 lines not on this page · raw message
drivers/scsi/bfa/bfa_fcs_lport.c +46 -23
213 lines not on this page · raw message
drivers/scsi/bfa/bfa_fcs_rport.c +6 -3
@@ -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);
drivers/scsi/bfa/bfa_ioc.c +26 -18
157 lines not on this page · raw message
drivers/scsi/bfa/bfa_ioc.h +0 -23
@@ -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 */
drivers/scsi/bfa/bfa_ioc_cb.c +2 -1
@@ -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;
drivers/scsi/bfa/bfa_ioc_ct.c +8 -4
@@ -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;
drivers/scsi/bfa/bfa_plog.h +0 -8
@@ -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__ */
drivers/scsi/bfa/bfa_port.c +3 -3
@@ -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;
drivers/scsi/bfa/bfa_port.h +0 -1
@@ -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,
drivers/scsi/bfa/bfa_svc.c +23 -15
@@ -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);
drivers/scsi/bfa/bfa_svc.h +0 -12
@@ -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);
drivers/scsi/bfa/bfad.c +51 -37
246 lines not on this page · raw message
drivers/scsi/bfa/bfad_attr.c +2 -2
@@ -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;
drivers/scsi/bfa/bfad_bsg.c +112 -112
896 lines not on this page · raw message
drivers/scsi/bfa/bfad_drv.h +1 -43
62 lines not on this page · raw message
drivers/scsi/bfa/bfad_im.c +16 -7
@@ -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;
drivers/scsi/bfa/bfad_im.h +0 -10
@@ -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);
Signature · 1 line
2.9.0
kbuild test robot
build botRe: [PATCH 1/5] bfa: mark symbols static where possible
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…
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 <[email protected]> :::::: CC: James Bottomley <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Re: [PATCH 1/5] bfa: mark symbols static where possible
Quoted 8 lines · CEST kbuild test robot
All errors (new ones prefixed by >>):
drivers/scsi/bfa/bfad.c: In function 'bfad_drv_uninit':Quoted 1 line
Quoted 1 line
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
Sudarsana Kalluru
maintainerRE: [PATCH 1/5] bfa: mark symbols static where possible
In reply to Arnd BergmannHi,
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:[email protected]]
Sent: 02 August 2016 20:53
To: Anil Gurumurthy <[email protected]>; Sudarsana Kalluru <[email protected]>
Cc: James E . J . Bottomley <[email protected]>; Martin K . Petersen <[email protected]>; linux-scsi <[email protected]>; linux-kernel <[email protected]>; Baoyou Xie <[email protected]>; Arnd Bergmann <[email protected]>
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.
--- 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(-)
drivers/scsi/bfa/bfa.h +0 -15
@@ -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);
drivers/scsi/bfa/bfa_core.c +12 -7
@@ -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;
drivers/scsi/bfa/bfa_fcbuild.c +1 -1
@@ -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 ));
drivers/scsi/bfa/bfa_fcbuild.h +0 -3
@@ -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,
drivers/scsi/bfa/bfa_fcpim.c +43 -23
232 lines not on this page · raw message
drivers/scsi/bfa/bfa_fcpim.h +0 -25
@@ -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);
drivers/scsi/bfa/bfa_fcs.c +20 -11
@@ -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);
drivers/scsi/bfa/bfa_fcs.h +0 -41
89 lines not on this page · raw message
drivers/scsi/bfa/bfa_fcs_lport.c +46 -23
213 lines not on this page · raw message
drivers/scsi/bfa/bfa_fcs_rport.c +6 -3
@@ -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);
drivers/scsi/bfa/bfa_ioc.c +26 -18
157 lines not on this page · raw message
drivers/scsi/bfa/bfa_ioc.h +0 -23
@@ -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 */
drivers/scsi/bfa/bfa_ioc_cb.c +2 -1
@@ -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;
drivers/scsi/bfa/bfa_ioc_ct.c +8 -4
@@ -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;
drivers/scsi/bfa/bfa_plog.h +0 -8
@@ -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__ */
drivers/scsi/bfa/bfa_port.c +3 -3
@@ -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;
drivers/scsi/bfa/bfa_port.h +0 -1
@@ -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,
drivers/scsi/bfa/bfa_svc.c +23 -15
@@ -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);
drivers/scsi/bfa/bfa_svc.h +0 -12
@@ -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);
drivers/scsi/bfa/bfad.c +51 -37
246 lines not on this page · raw message
drivers/scsi/bfa/bfad_attr.c +2 -2
@@ -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;
drivers/scsi/bfa/bfad_bsg.c +112 -112
896 lines not on this page · raw message
drivers/scsi/bfa/bfad_drv.h +1 -43
62 lines not on this page · raw message
drivers/scsi/bfa/bfad_im.c +16 -7
@@ -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;
drivers/scsi/bfa/bfad_im.h +0 -10
@@ -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);
Signature · 1 line
2.9.0
PATCH 2/5 bfa: remove unused variables
In reply to Arnd BergmannBuilding 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.
--- 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(-)
drivers/scsi/bfa/bfa_fcpim.c +1 -5
@@ -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); } }
drivers/scsi/bfa/bfa_fcs_rport.c +0 -3
@@ -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.
drivers/scsi/bfa/bfa_ioc.c +6 -12
@@ -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.
drivers/scsi/bfa/bfa_svc.c +0 -3
@@ -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;
drivers/scsi/bfa/bfad_attr.c +0 -3
@@ -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);
Signature · 1 line
2.9.0
PATCH 3/5 bfa: rename some global variables
In reply to Arnd BergmannThe 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.
--- 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(-)
drivers/scsi/bfa/bfad.c +10 -10
@@ -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);
drivers/scsi/bfa/bfad_attr.c +1 -1
@@ -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 */
drivers/scsi/bfa/bfad_drv.h +2 -2
@@ -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;
drivers/scsi/bfa/bfad_im.c +3 -3
@@ -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 */
Signature · 1 line
2.9.0
PATCH 4/5 bfa: remove unused functions from fbbuild.c
In reply to Arnd BergmannA 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.
--- drivers/scsi/bfa/bfa_fcbuild.c | 607 ----------------------------------------- drivers/scsi/bfa/bfa_fcbuild.h | 87 ------ 2 files changed, 694 deletions(-)
drivers/scsi/bfa/bfa_fcbuild.c +0 -607
@@ -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. */
drivers/scsi/bfa/bfa_fcbuild.h +0 -87
142 lines not on this page · raw message
Signature · 1 line
2.9.0
PATCH 5/5 bfa: remove more unused functions
In reply to Arnd BergmannThis 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.
--- 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(-)
drivers/scsi/bfa/bfa.h +0 -2
@@ -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);
drivers/scsi/bfa/bfa_core.c +0 -35
@@ -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 ; -}
drivers/scsi/bfa/bfa_fcpim.c +0 -9
@@ -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
drivers/scsi/bfa/bfa_fcpim.h +0 -1
@@ -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);/*
drivers/scsi/bfa/bfa_fcs.h +0 -13
@@ -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);
drivers/scsi/bfa/bfa_fcs_lport.c +0 -142
172 lines not on this page · raw message
drivers/scsi/bfa/bfa_fcs_rport.c +0 -36
@@ -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. */
drivers/scsi/bfa/bfa_ioc.c +0 -21
@@ -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) {
drivers/scsi/bfa/bfa_ioc.h +0 -2
@@ -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);
drivers/scsi/bfa/bfa_svc.c +0 -54
84 lines not on this page · raw message
drivers/scsi/bfa/bfa_svc.h +0 -5
@@ -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);
drivers/scsi/bfa/bfad.c +0 -20
@@ -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) {
drivers/scsi/bfa/bfad_drv.h +0 -1
@@ -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);
Signature · 1 line
2.9.0
Sudarsana Kalluru
maintainerHi,
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:[email protected]]
Sent: 02 August 2016 20:53
To: Anil Gurumurthy <[email protected]>; Sudarsana Kalluru <[email protected]>
Cc: James E . J . Bottomley <[email protected]>; Martin K . Petersen <[email protected]>; linux-scsi <[email protected]>; linux-kernel <[email protected]>; Baoyou Xie <[email protected]>; Arnd Bergmann <[email protected]>
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