Skip to content

Commit a0113b4

Browse files
Merge patch series "scsi: bfa: Remove deadcode"
linux@treblig.org says: Hi, This removes a pile of dead functions in the SCSI bfa driver. These were spotted by hunting for unused symbols in a unmodular kernel build, and then double checking by grepping for the function name. It's been build tested only, I don't have the hardware, but it's strictly full function (and the occasional struct) deletion, so there should be no change in functionality. Thanks to David Hildenbrand for the suggestion of hunting for unused symbols. Dave Link: https://lore.kernel.org/r/20240915125633.25036-1-linux@treblig.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2 parents 94c4c5d + 8d7cfe9 commit a0113b4

15 files changed

Lines changed: 0 additions & 389 deletions

drivers/scsi/bfa/bfa.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,6 @@ bfa_reqq_winit(struct bfa_reqq_wait_s *wqe, void (*qresume) (void *cbarg),
138138
} while (0)
139139

140140

141-
/*
142-
* PCI devices supported by the current BFA
143-
*/
144-
struct bfa_pciid_s {
145-
u16 device_id;
146-
u16 vendor_id;
147-
};
148-
149141
extern char bfa_version[];
150142

151143
struct bfa_iocfc_regs_s {
@@ -408,9 +400,7 @@ int bfa_iocfc_get_pbc_vports(struct bfa_s *bfa,
408400
(((&(_bfa)->modules.dconf_mod)->min_cfg) \
409401
? BFA_LUNMASK_MINCFG : ((bfa_get_lun_mask(_bfa))->status))
410402

411-
void bfa_get_pciids(struct bfa_pciid_s **pciids, int *npciids);
412403
void bfa_cfg_get_default(struct bfa_iocfc_cfg_s *cfg);
413-
void bfa_cfg_get_min(struct bfa_iocfc_cfg_s *cfg);
414404
void bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg,
415405
struct bfa_meminfo_s *meminfo,
416406
struct bfa_s *bfa);

drivers/scsi/bfa/bfa_core.c

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,24 +1933,6 @@ bfa_comp_free(struct bfa_s *bfa, struct list_head *comp_q)
19331933
}
19341934
}
19351935

1936-
/*
1937-
* Return the list of PCI vendor/device id lists supported by this
1938-
* BFA instance.
1939-
*/
1940-
void
1941-
bfa_get_pciids(struct bfa_pciid_s **pciids, int *npciids)
1942-
{
1943-
static struct bfa_pciid_s __pciids[] = {
1944-
{BFA_PCI_VENDOR_ID_BROCADE, BFA_PCI_DEVICE_ID_FC_8G2P},
1945-
{BFA_PCI_VENDOR_ID_BROCADE, BFA_PCI_DEVICE_ID_FC_8G1P},
1946-
{BFA_PCI_VENDOR_ID_BROCADE, BFA_PCI_DEVICE_ID_CT},
1947-
{BFA_PCI_VENDOR_ID_BROCADE, BFA_PCI_DEVICE_ID_CT_FC},
1948-
};
1949-
1950-
*npciids = ARRAY_SIZE(__pciids);
1951-
*pciids = __pciids;
1952-
}
1953-
19541936
/*
19551937
* Use this function query the default struct bfa_iocfc_cfg_s value (compiled
19561938
* into BFA layer). The OS driver can then turn back and overwrite entries that
@@ -1987,20 +1969,3 @@ bfa_cfg_get_default(struct bfa_iocfc_cfg_s *cfg)
19871969
cfg->drvcfg.delay_comp = BFA_FALSE;
19881970

19891971
}
1990-
1991-
void
1992-
bfa_cfg_get_min(struct bfa_iocfc_cfg_s *cfg)
1993-
{
1994-
bfa_cfg_get_default(cfg);
1995-
cfg->fwcfg.num_ioim_reqs = BFA_IOIM_MIN;
1996-
cfg->fwcfg.num_tskim_reqs = BFA_TSKIM_MIN;
1997-
cfg->fwcfg.num_fcxp_reqs = BFA_FCXP_MIN;
1998-
cfg->fwcfg.num_uf_bufs = BFA_UF_MIN;
1999-
cfg->fwcfg.num_rports = BFA_RPORT_MIN;
2000-
cfg->fwcfg.num_fwtio_reqs = 0;
2001-
2002-
cfg->drvcfg.num_sgpgs = BFA_SGPG_MIN;
2003-
cfg->drvcfg.num_reqq_elems = BFA_REQQ_NELEMS_MIN;
2004-
cfg->drvcfg.num_rspq_elems = BFA_RSPQ_NELEMS_MIN;
2005-
cfg->drvcfg.min_cfg = BFA_TRUE;
2006-
}

drivers/scsi/bfa/bfa_defs_fcs.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -124,28 +124,6 @@ enum bfa_lport_offline_reason {
124124
BFA_LPORT_OFFLINE_FAB_LOGOUT,
125125
};
126126

127-
/*
128-
* FCS lport info.
129-
*/
130-
struct bfa_lport_info_s {
131-
u8 port_type; /* bfa_lport_type_t : physical or
132-
* virtual */
133-
u8 port_state; /* one of bfa_lport_state values */
134-
u8 offline_reason; /* one of bfa_lport_offline_reason_t
135-
* values */
136-
wwn_t port_wwn;
137-
wwn_t node_wwn;
138-
139-
/*
140-
* following 4 feilds are valid for Physical Ports only
141-
*/
142-
u32 max_vports_supp; /* Max supported vports */
143-
u32 num_vports_inuse; /* Num of in use vports */
144-
u32 max_rports_supp; /* Max supported rports */
145-
u32 num_rports_inuse; /* Num of doscovered rports */
146-
147-
};
148-
149127
/*
150128
* FCS port statistics
151129
*/

drivers/scsi/bfa/bfa_fcpim.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3412,15 +3412,6 @@ bfa_tskim_iocdisable_ios(struct bfa_tskim_s *tskim)
34123412
}
34133413
}
34143414

3415-
/*
3416-
* Notification on completions from related ioim.
3417-
*/
3418-
void
3419-
bfa_tskim_iodone(struct bfa_tskim_s *tskim)
3420-
{
3421-
bfa_wc_down(&tskim->wc);
3422-
}
3423-
34243415
/*
34253416
* Handle IOC h/w failure notification from itnim.
34263417
*/

drivers/scsi/bfa/bfa_fcpim.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ void bfa_ioim_tov(struct bfa_ioim_s *ioim);
339339

340340
void bfa_tskim_attach(struct bfa_fcpim_s *fcpim);
341341
void bfa_tskim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
342-
void bfa_tskim_iodone(struct bfa_tskim_s *tskim);
343342
void bfa_tskim_iocdisable(struct bfa_tskim_s *tskim);
344343
void bfa_tskim_cleanup(struct bfa_tskim_s *tskim);
345344
void bfa_tskim_res_recfg(struct bfa_s *bfa, u16 num_tskim_fw);

drivers/scsi/bfa/bfa_fcs.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -373,15 +373,11 @@ bfa_boolean_t bfa_fcs_lport_is_online(struct bfa_fcs_lport_s *port);
373373
struct bfa_fcs_lport_s *bfa_fcs_get_base_port(struct bfa_fcs_s *fcs);
374374
void bfa_fcs_lport_get_rport_quals(struct bfa_fcs_lport_s *port,
375375
struct bfa_rport_qualifier_s rport[], int *nrports);
376-
wwn_t bfa_fcs_lport_get_rport(struct bfa_fcs_lport_s *port, wwn_t wwn,
377-
int index, int nrports, bfa_boolean_t bwwn);
378376

379377
struct bfa_fcs_lport_s *bfa_fcs_lookup_port(struct bfa_fcs_s *fcs,
380378
u16 vf_id, wwn_t lpwwn);
381379

382380
void bfa_fcs_lport_set_symname(struct bfa_fcs_lport_s *port, char *symname);
383-
void bfa_fcs_lport_get_info(struct bfa_fcs_lport_s *port,
384-
struct bfa_lport_info_s *port_info);
385381
void bfa_fcs_lport_get_attr(struct bfa_fcs_lport_s *port,
386382
struct bfa_lport_attr_s *port_attr);
387383
void bfa_fcs_lport_get_stats(struct bfa_fcs_lport_s *fcs_port,
@@ -416,8 +412,6 @@ struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_old_pid(
416412
struct bfa_fcs_lport_s *port, u32 pid);
417413
struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_pwwn(
418414
struct bfa_fcs_lport_s *port, wwn_t pwwn);
419-
struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_nwwn(
420-
struct bfa_fcs_lport_s *port, wwn_t nwwn);
421415
struct bfa_fcs_rport_s *bfa_fcs_lport_get_rport_by_qualifier(
422416
struct bfa_fcs_lport_s *port, wwn_t pwwn, u32 pid);
423417
void bfa_fcs_lport_add_rport(struct bfa_fcs_lport_s *port,
@@ -486,15 +480,13 @@ bfa_status_t bfa_fcs_pbc_vport_create(struct bfa_fcs_vport_s *vport,
486480
struct bfa_fcs_s *fcs, u16 vf_id,
487481
struct bfa_lport_cfg_s *port_cfg,
488482
struct bfad_vport_s *vport_drv);
489-
bfa_boolean_t bfa_fcs_is_pbc_vport(struct bfa_fcs_vport_s *vport);
490483
bfa_status_t bfa_fcs_vport_delete(struct bfa_fcs_vport_s *vport);
491484
bfa_status_t bfa_fcs_vport_start(struct bfa_fcs_vport_s *vport);
492485
bfa_status_t bfa_fcs_vport_stop(struct bfa_fcs_vport_s *vport);
493486
void bfa_fcs_vport_get_attr(struct bfa_fcs_vport_s *vport,
494487
struct bfa_vport_attr_s *vport_attr);
495488
struct bfa_fcs_vport_s *bfa_fcs_vport_lookup(struct bfa_fcs_s *fcs,
496489
u16 vf_id, wwn_t vpwwn);
497-
void bfa_fcs_vport_cleanup(struct bfa_fcs_vport_s *vport);
498490
void bfa_fcs_vport_online(struct bfa_fcs_vport_s *vport);
499491
void bfa_fcs_vport_offline(struct bfa_fcs_vport_s *vport);
500492
void bfa_fcs_vport_delete_comp(struct bfa_fcs_vport_s *vport);
@@ -623,8 +615,6 @@ void bfa_fcs_rport_get_attr(struct bfa_fcs_rport_s *rport,
623615
struct bfa_rport_attr_s *attr);
624616
struct bfa_fcs_rport_s *bfa_fcs_rport_lookup(struct bfa_fcs_lport_s *port,
625617
wwn_t rpwwn);
626-
struct bfa_fcs_rport_s *bfa_fcs_rport_lookup_by_nwwn(
627-
struct bfa_fcs_lport_s *port, wwn_t rnwwn);
628618
void bfa_fcs_rport_set_del_timeout(u8 rport_tmo);
629619
void bfa_fcs_rport_set_max_logins(u32 max_logins);
630620
void bfa_fcs_rport_uf_recv(struct bfa_fcs_rport_s *rport,
@@ -633,8 +623,6 @@ void bfa_fcs_rport_scn(struct bfa_fcs_rport_s *rport);
633623

634624
struct bfa_fcs_rport_s *bfa_fcs_rport_create(struct bfa_fcs_lport_s *port,
635625
u32 pid);
636-
void bfa_fcs_rport_start(struct bfa_fcs_lport_s *port, struct fchs_s *rx_fchs,
637-
struct fc_logi_s *plogi_rsp);
638626
void bfa_fcs_rport_plogi_create(struct bfa_fcs_lport_s *port,
639627
struct fchs_s *rx_fchs,
640628
struct fc_logi_s *plogi);

drivers/scsi/bfa/bfa_fcs_lport.c

Lines changed: 0 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -937,25 +937,6 @@ bfa_fcs_lport_get_rport_by_pwwn(struct bfa_fcs_lport_s *port, wwn_t pwwn)
937937
return NULL;
938938
}
939939

940-
/*
941-
* NWWN based Lookup for a R-Port in the Port R-Port Queue
942-
*/
943-
struct bfa_fcs_rport_s *
944-
bfa_fcs_lport_get_rport_by_nwwn(struct bfa_fcs_lport_s *port, wwn_t nwwn)
945-
{
946-
struct bfa_fcs_rport_s *rport;
947-
struct list_head *qe;
948-
949-
list_for_each(qe, &port->rport_q) {
950-
rport = (struct bfa_fcs_rport_s *) qe;
951-
if (wwn_is_equal(rport->nwwn, nwwn))
952-
return rport;
953-
}
954-
955-
bfa_trc(port->fcs, nwwn);
956-
return NULL;
957-
}
958-
959940
/*
960941
* PWWN & PID based Lookup for a R-Port in the Port R-Port Queue
961942
*/
@@ -5645,54 +5626,6 @@ bfa_fcs_get_base_port(struct bfa_fcs_s *fcs)
56455626
return &fcs->fabric.bport;
56465627
}
56475628

5648-
wwn_t
5649-
bfa_fcs_lport_get_rport(struct bfa_fcs_lport_s *port, wwn_t wwn, int index,
5650-
int nrports, bfa_boolean_t bwwn)
5651-
{
5652-
struct list_head *qh, *qe;
5653-
struct bfa_fcs_rport_s *rport = NULL;
5654-
int i;
5655-
struct bfa_fcs_s *fcs;
5656-
5657-
if (port == NULL || nrports == 0)
5658-
return (wwn_t) 0;
5659-
5660-
fcs = port->fcs;
5661-
bfa_trc(fcs, (u32) nrports);
5662-
5663-
i = 0;
5664-
qh = &port->rport_q;
5665-
qe = bfa_q_first(qh);
5666-
5667-
while ((qe != qh) && (i < nrports)) {
5668-
rport = (struct bfa_fcs_rport_s *) qe;
5669-
if (bfa_ntoh3b(rport->pid) > 0xFFF000) {
5670-
qe = bfa_q_next(qe);
5671-
bfa_trc(fcs, (u32) rport->pwwn);
5672-
bfa_trc(fcs, rport->pid);
5673-
bfa_trc(fcs, i);
5674-
continue;
5675-
}
5676-
5677-
if (bwwn) {
5678-
if (!memcmp(&wwn, &rport->pwwn, 8))
5679-
break;
5680-
} else {
5681-
if (i == index)
5682-
break;
5683-
}
5684-
5685-
i++;
5686-
qe = bfa_q_next(qe);
5687-
}
5688-
5689-
bfa_trc(fcs, i);
5690-
if (rport)
5691-
return rport->pwwn;
5692-
else
5693-
return (wwn_t) 0;
5694-
}
5695-
56965629
void
56975630
bfa_fcs_lport_get_rport_quals(struct bfa_fcs_lport_s *port,
56985631
struct bfa_rport_qualifier_s rports[], int *nrports)
@@ -5823,54 +5756,6 @@ bfa_fcs_lookup_port(struct bfa_fcs_s *fcs, u16 vf_id, wwn_t lpwwn)
58235756
return NULL;
58245757
}
58255758

5826-
/*
5827-
* API corresponding to NPIV_VPORT_GETINFO.
5828-
*/
5829-
void
5830-
bfa_fcs_lport_get_info(struct bfa_fcs_lport_s *port,
5831-
struct bfa_lport_info_s *port_info)
5832-
{
5833-
5834-
bfa_trc(port->fcs, port->fabric->fabric_name);
5835-
5836-
if (port->vport == NULL) {
5837-
/*
5838-
* This is a Physical port
5839-
*/
5840-
port_info->port_type = BFA_LPORT_TYPE_PHYSICAL;
5841-
5842-
/*
5843-
* @todo : need to fix the state & reason
5844-
*/
5845-
port_info->port_state = 0;
5846-
port_info->offline_reason = 0;
5847-
5848-
port_info->port_wwn = bfa_fcs_lport_get_pwwn(port);
5849-
port_info->node_wwn = bfa_fcs_lport_get_nwwn(port);
5850-
5851-
port_info->max_vports_supp =
5852-
bfa_lps_get_max_vport(port->fcs->bfa);
5853-
port_info->num_vports_inuse =
5854-
port->fabric->num_vports;
5855-
port_info->max_rports_supp = BFA_FCS_MAX_RPORTS_SUPP;
5856-
port_info->num_rports_inuse = port->num_rports;
5857-
} else {
5858-
/*
5859-
* This is a virtual port
5860-
*/
5861-
port_info->port_type = BFA_LPORT_TYPE_VIRTUAL;
5862-
5863-
/*
5864-
* @todo : need to fix the state & reason
5865-
*/
5866-
port_info->port_state = 0;
5867-
port_info->offline_reason = 0;
5868-
5869-
port_info->port_wwn = bfa_fcs_lport_get_pwwn(port);
5870-
port_info->node_wwn = bfa_fcs_lport_get_nwwn(port);
5871-
}
5872-
}
5873-
58745759
void
58755760
bfa_fcs_lport_get_stats(struct bfa_fcs_lport_s *fcs_port,
58765761
struct bfa_lport_stats_s *port_stats)
@@ -6567,15 +6452,6 @@ bfa_fcs_vport_offline(struct bfa_fcs_vport_s *vport)
65676452
bfa_sm_send_event(vport, BFA_FCS_VPORT_SM_OFFLINE);
65686453
}
65696454

6570-
/*
6571-
* Cleanup notification from fabric SM on link timer expiry.
6572-
*/
6573-
void
6574-
bfa_fcs_vport_cleanup(struct bfa_fcs_vport_s *vport)
6575-
{
6576-
vport->vport_stats.fab_cleanup++;
6577-
}
6578-
65796455
/*
65806456
* Stop notification from fabric SM. To be invoked from within FCS.
65816457
*/
@@ -6698,24 +6574,6 @@ bfa_fcs_pbc_vport_create(struct bfa_fcs_vport_s *vport, struct bfa_fcs_s *fcs,
66986574
return rc;
66996575
}
67006576

6701-
/*
6702-
* Use this function to findout if this is a pbc vport or not.
6703-
*
6704-
* @param[in] vport - pointer to bfa_fcs_vport_t.
6705-
*
6706-
* @returns None
6707-
*/
6708-
bfa_boolean_t
6709-
bfa_fcs_is_pbc_vport(struct bfa_fcs_vport_s *vport)
6710-
{
6711-
6712-
if (vport && (vport->lport.port_cfg.preboot_vp == BFA_TRUE))
6713-
return BFA_TRUE;
6714-
else
6715-
return BFA_FALSE;
6716-
6717-
}
6718-
67196577
/*
67206578
* Use this function initialize the vport.
67216579
*

0 commit comments

Comments
 (0)