Skip to contentSkip to conversation

dead code and missing statics in lpfc

PATCH In review Christoph Hellwig 2 participants 2 messages May 31, 2004 – Jun 6, 2004 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dead code and missing statics in lpfc

- remove dead EXPORT_SYMBOLS
- mark everything static that can be (thanks to Tridge's findstatic.pl)
- kill all dead functions
(- small lpfc_evt_iocb_free fixes that sneaked into the context)

lpfc_crtn.h +0 -17
diff -uNr lpfcdriver-2.6-8.0.2/lpfc_crtn.h lpfcdriver-2.6-8.0.2.hch/lpfc_crtn.h
@@ -101,10 +101,6 @@
 
 int lpfc_check_sparm(lpfcHBA_t *, LPFC_NODELIST_t *, SERV_PARM *, uint32_t);
 int lpfc_geportname(NAME_TYPE *, NAME_TYPE *);
-uint32_t lpfc_add_bind(lpfcHBA_t * phba, uint8_t bind_type,
-		       void *bind_id, uint32_t scsi_id);
-uint32_t lpfc_del_bind(lpfcHBA_t * phba, uint8_t bind_type,
-		       void *bind_id, uint32_t scsi_id);
 
 int lpfc_initial_flogi(lpfcHBA_t *);
 int lpfc_issue_els_plogi(lpfcHBA_t *, LPFC_NODELIST_t *, uint8_t);
@@ -112,8 +108,6 @@
 int lpfc_issue_els_adisc(lpfcHBA_t *, LPFC_NODELIST_t *, uint8_t);
 int lpfc_issue_els_logo(lpfcHBA_t *, LPFC_NODELIST_t *, uint8_t);
 int lpfc_issue_els_scr(lpfcHBA_t *, uint32_t, uint8_t);
-LPFC_IOCBQ_t *lpfc_prep_els_iocb(lpfcHBA_t *, uint8_t expectRsp,
-				uint16_t, uint8_t, LPFC_NODELIST_t *, uint32_t);
 int lpfc_els_free_iocb(lpfcHBA_t *, LPFC_IOCBQ_t *);
 void lpfc_cmpl_els_flogi(lpfcHBA_t *, LPFC_IOCBQ_t *, LPFC_IOCBQ_t *);
 void lpfc_cmpl_els_plogi(lpfcHBA_t *, LPFC_IOCBQ_t *, LPFC_IOCBQ_t *);
@@ -138,7 +132,6 @@
 
 void lpfc_ct_unsol_event(lpfcHBA_t *, LPFC_SLI_RING_t *, LPFC_IOCBQ_t *);
 int lpfc_ns_cmd(lpfcHBA_t *, LPFC_NODELIST_t *, int);
-int lpfc_issue_ct_rsp(lpfcHBA_t *, uint32_t, DMABUF_t *, DMABUFEXT_t *);
 int lpfc_fdmi_cmd(lpfcHBA_t *, LPFC_NODELIST_t *, int);
 void lpfc_fdmi_tmo(unsigned long);
 
@@ -150,8 +143,6 @@
 void lpfc_hba_init(lpfcHBA_t *);
 int lpfc_post_buffer(lpfcHBA_t *, LPFC_SLI_RING_t *, int, int);
 void lpfc_cleanup(lpfcHBA_t *, uint32_t);
-int lpfc_online(lpfcHBA_t *);
-int lpfc_offline(lpfcHBA_t *);
 int lpfc_scsi_free(lpfcHBA_t *);
 int lpfc_parse_binding_entry(lpfcHBA_t *, uint8_t *, uint8_t *,
 			     int, int, int, unsigned int *, int, int *);
@@ -162,7 +153,6 @@
 int lpfc_hba_put_event(lpfcHBA_t *, uint32_t, uint32_t, uint32_t, uint32_t,
 		      uint32_t);
 void lpfc_get_hba_model_desc(lpfcHBA_t *, uint8_t *, uint8_t *);
-void lpfc_get_hba_sym_node_name(lpfcHBA_t *, uint8_t *);
 
 
 int lpfc_sli_queue_setup(lpfcHBA_t *);
@@ -200,7 +190,6 @@
 int lpfc_sli_issue_mbox(lpfcHBA_t *, LPFC_MBOXQ_t *, uint32_t);
 int lpfc_sli_issue_iocb(lpfcHBA_t *, LPFC_SLI_RING_t *, LPFC_IOCBQ_t *,
 			uint32_t);
-int lpfc_sli_brdreset(lpfcHBA_t *);
 void lpfc_sli_pcimem_bcopy(uint32_t *, uint32_t *, uint32_t);
 int lpfc_sli_ringpostbuf_put(lpfcHBA_t *, LPFC_SLI_RING_t *, DMABUF_t *);
 DMABUF_t *lpfc_sli_ringpostbuf_get(lpfcHBA_t *, LPFC_SLI_RING_t *, dma_addr_t);
@@ -220,17 +209,12 @@
 
 int lpfc_sli_issue_iocb_wait(lpfcHBA_t *, LPFC_SLI_RING_t *,
 			    LPFC_IOCBQ_t *, uint32_t, LPFC_IOCBQ_t *, uint32_t);
-int lpfc_sli_issue_mbox_wait(lpfcHBA_t *, LPFC_MBOXQ_t *, uint32_t);
-int lpfc_sleep(lpfcHBA_t *, void *, long tmo);
-void lpfc_wakeup(lpfcHBA_t *, void *);
 
 LPFC_SCSI_BUF_t *lpfc_get_scsi_buf(lpfcHBA_t *);
 void lpfc_free_scsi_buf(LPFC_SCSI_BUF_t *);
 void lpfc_map_fcp_cmnd_to_bpl(lpfcHBA_t *, LPFC_SCSI_BUF_t *);
 void lpfc_free_scsi_cmd(LPFC_SCSI_BUF_t *);
 uint32_t lpfc_os_timeout_transform(lpfcHBA_t *, uint32_t);
-int lpfc_scsi_lun_reset(LPFC_SCSI_BUF_t *, lpfcHBA_t *, uint32_t);
-int lpfc_scsi_tgt_reset(LPFC_SCSI_BUF_t *, lpfcHBA_t *, uint32_t);
 
 lpfcHBA_t *lpfc_get_phba_by_inst(int);
 
@@ -257,7 +241,6 @@
 
 void *lpfc_mbuf_alloc(lpfcHBA_t *, int, dma_addr_t *);
 void lpfc_mbuf_free(lpfcHBA_t *, void *, dma_addr_t);
-int lpfc_valid_lun(LPFCSCSITARGET_t *, uint64_t);
 
 void lpfc_sleep_ms(lpfcHBA_t *, int);
 
lpfc_ct.c +2 -60

80 lines not on this page · raw message

Binary files lpfcdriver-2.6-8.0.2/lpfc_ct.o and lpfcdriver-2.6-8.0.2.hch/lpfc_ct.o differ

lpfc_els.c +3 -1
diff -uNr lpfcdriver-2.6-8.0.2/lpfc_els.c lpfcdriver-2.6-8.0.2.hch/lpfc_els.c
@@ -57,6 +57,8 @@
 static int lpfc_issue_els_flogi(lpfcHBA_t *, LPFC_NODELIST_t *, uint8_t);
 static void lpfc_more_plogi(lpfcHBA_t *);
 static void lpfc_more_adisc(lpfcHBA_t *);
+static LPFC_IOCBQ_t *lpfc_prep_els_iocb(lpfcHBA_t *, uint8_t, uint16_t,
+		uint8_t, LPFC_NODELIST_t *, uint32_t);
 
 static int lpfc_max_els_tries = 3;
 
@@ -1379,7 +1381,7 @@
 	return (0);
 }
 
-LPFC_IOCBQ_t *
+static LPFC_IOCBQ_t *
 lpfc_prep_els_iocb(lpfcHBA_t * phba,
 		   uint8_t expectRsp,
 		   uint16_t cmdSize,

Binary files lpfcdriver-2.6-8.0.2/lpfc_els.o and lpfcdriver-2.6-8.0.2.hch/lpfc_els.o differ

lpfc_fcp.c +7 -85

127 lines not on this page · raw message

Binary files lpfcdriver-2.6-8.0.2/lpfc_fcp.o and lpfcdriver-2.6-8.0.2.hch/lpfc_fcp.o differ Binary files lpfcdriver-2.6-8.0.2/lpfc_hbadisc.o and lpfcdriver-2.6-8.0.2.hch/lpfc_hbadisc.o differ

lpfc_init.c +4 -2
diff -uNr lpfcdriver-2.6-8.0.2/lpfc_init.c lpfcdriver-2.6-8.0.2.hch/lpfc_init.c
@@ -47,6 +47,8 @@
 static void lpfc_establish_link_tmo(unsigned long ptr);
 static int lpfc_check_for_vpd = 1;
 static int lpfc_rdrev_wd30 = 0;
+static int lpfc_online(lpfcHBA_t *);
+static int lpfc_offline(lpfcHBA_t *);
 
 
 /************************************************************************/
@@ -1153,7 +1155,7 @@
 	spin_unlock_irqrestore(&(phba->drvrlock), iflag);
 }
 
-int
+static int
 lpfc_online(lpfcHBA_t * phba)
 {
 	uint32_t timeout;
@@ -1199,7 +1201,7 @@
 	return (0);
 }
 
-int
+static int
 lpfc_offline(lpfcHBA_t * phba)
 {
 	LPFC_SLI_RING_t *pring;

Binary files lpfcdriver-2.6-8.0.2/lpfc_init.o and lpfcdriver-2.6-8.0.2.hch/lpfc_init.o differ Binary files lpfcdriver-2.6-8.0.2/lpfc_logmsg.o and lpfcdriver-2.6-8.0.2.hch/lpfc_logmsg.o differ Binary files lpfcdriver-2.6-8.0.2/lpfc_mbox.o and lpfcdriver-2.6-8.0.2.hch/lpfc_mbox.o differ Binary files lpfcdriver-2.6-8.0.2/lpfc_mem.o and lpfcdriver-2.6-8.0.2.hch/lpfc_mem.o differ

lpfc_nportdisc.c +0 -258

264 lines not on this page · raw message

lpfc_scsiport.c +2 -2
diff -uNr lpfcdriver-2.6-8.0.2/lpfc_scsiport.c lpfcdriver-2.6-8.0.2.hch/lpfc_scsiport.c
@@ -537,7 +411,7 @@
 
 }
 
-int
+static int
 lpfc_scsi_lun_reset(LPFC_SCSI_BUF_t * lpfc_cmd, 
 		    lpfcHBA_t *phba, uint32_t flag)
 {
@@ -640,7 +514,7 @@
 
 }
 
-int
+static int
 lpfc_scsi_tgt_reset(LPFC_SCSI_BUF_t * lpfc_cmd,
 		    lpfcHBA_t * phba, uint32_t flag)
 {
lpfc_sli.c +2 -60

79 lines not on this page · raw message

Binary files lpfcdriver-2.6-8.0.2/lpfc_sli.o and lpfcdriver-2.6-8.0.2.hch/lpfc_sli.o differ Binary files lpfcdriver-2.6-8.0.2/lpfc_sysfs.o and lpfcdriver-2.6-8.0.2.hch/lpfc_sysfs.o differ

#1 lore raw
Quoted 5 lines · Christoph Hellwig

- remove dead EXPORT_SYMBOLS
- mark everything static that can be (thanks to Tridge's findstatic.pl)
- kill all dead functions
(- small lpfc_evt_iocb_free fixes that sneaked into the context)

resend of the patch after you nicely broke it with random changes in today code drop.

p.s. it seems emulex let some windows drone make the tarball, it's completely
fscked up with broken dos line endings
p.s. v2 the fs attribute and sysfs support in the tarball is completely bullshit. take a look at what qlogic does and fix it up.

lpfc_crtn.h +0 -19
diff -urp lpfcdriver-2.6-8.0.3/lpfc_crtn.h lpfcdriver-2.6-8.0.3.hch/lpfc_crtn.h
@@ -74,11 +74,6 @@ int lpfc_no_rpi(struct lpfc_hba *, struc
 int lpfc_freenode(struct lpfc_hba *, struct lpfc_nodelist *);
 int lpfc_nlp_remove(struct lpfc_hba *, struct lpfc_nodelist *);
 struct lpfc_nodelist *lpfc_findnode_did(struct lpfc_hba *, uint32_t, uint32_t);
-struct lpfc_nodelist *lpfc_findnode_scsiid(struct lpfc_hba *, uint32_t);
-struct lpfc_nodelist *lpfc_findnode_wwpn(struct lpfc_hba *, uint32_t,
-				    struct lpfc_name *);
-struct lpfc_nodelist *lpfc_findnode_wwnn(struct lpfc_hba *, uint32_t,
-				    struct lpfc_name *);
 void lpfc_disc_list_loopmap(struct lpfc_hba *);
 void lpfc_disc_start(struct lpfc_hba *);
 void lpfc_disc_flush_list(struct lpfc_hba *);
@@ -118,9 +113,6 @@ int lpfc_issue_els_prli(struct lpfc_hba 
 int lpfc_issue_els_adisc(struct lpfc_hba *, struct lpfc_nodelist *, uint8_t);
 int lpfc_issue_els_logo(struct lpfc_hba *, struct lpfc_nodelist *, uint8_t);
 int lpfc_issue_els_scr(struct lpfc_hba *, uint32_t, uint8_t);
-struct lpfc_iocbq *lpfc_prep_els_iocb(struct lpfc_hba *, uint8_t expectRsp,
-				      uint16_t, uint8_t, struct lpfc_nodelist *,
-				      uint32_t);
 int lpfc_els_free_iocb(struct lpfc_hba *, struct lpfc_iocbq *);
 void lpfc_cmpl_els_flogi(struct lpfc_hba *, struct lpfc_iocbq *,
 			 struct lpfc_iocbq *);
@@ -166,8 +158,6 @@ void lpfc_handle_latt(struct lpfc_hba *)
 void lpfc_hba_init(struct lpfc_hba *);
 int lpfc_post_buffer(struct lpfc_hba *, struct lpfc_sli_ring *, int, int);
 void lpfc_cleanup(struct lpfc_hba *, uint32_t);
-int lpfc_online(struct lpfc_hba *);
-int lpfc_offline(struct lpfc_hba *);
 int lpfc_scsi_free(struct lpfc_hba *);
 int lpfc_parse_binding_entry(struct lpfc_hba *, uint8_t *, uint8_t *,
 			     int, int, int, unsigned int *, int, int *);
@@ -215,7 +205,6 @@ int lpfc_sli_intr(struct lpfc_hba *);
 int lpfc_sli_issue_mbox(struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t);
 int lpfc_sli_issue_iocb(struct lpfc_hba *, struct lpfc_sli_ring *,
 			struct lpfc_iocbq *, uint32_t);
-int lpfc_sli_brdreset(struct lpfc_hba *);
 void lpfc_sli_pcimem_bcopy(uint32_t *, uint32_t *, uint32_t);
 int lpfc_sli_ringpostbuf_put(struct lpfc_hba *, struct lpfc_sli_ring *,
 			     DMABUF_t *);
@@ -240,22 +229,14 @@ void lpfc_start_timer(struct lpfc_hba *,
 void lpfc_stop_timer(struct clk_data *);
 
 
-int lpfc_sli_issue_iocb_wait(struct lpfc_hba *, struct lpfc_sli_ring *,
-			     struct lpfc_iocbq *, uint32_t, struct lpfc_iocbq *,
-			     uint32_t);
 LPFC_SCSI_BUF_t *lpfc_get_scsi_buf(struct lpfc_hba *);
 void lpfc_free_scsi_buf(LPFC_SCSI_BUF_t *);
 void lpfc_map_fcp_cmnd_to_bpl(struct lpfc_hba *, LPFC_SCSI_BUF_t *);
 void lpfc_free_scsi_cmd(LPFC_SCSI_BUF_t *);
 uint32_t lpfc_os_timeout_transform(struct lpfc_hba *, uint32_t);
-int lpfc_scsi_lun_reset(LPFC_SCSI_BUF_t *, struct lpfc_hba *, uint32_t);
-int lpfc_scsi_tgt_reset(LPFC_SCSI_BUF_t *, struct lpfc_hba *, uint32_t);
 
 struct lpfc_hba *lpfc_get_phba_by_inst(int);
 
-struct lpfc_bindlist *lpfc_assign_scsid(struct lpfc_hba *,
-					struct lpfc_nodelist *, int);
-
 void lpfc_sched_init_hba(struct lpfc_hba *, uint16_t);
 void lpfc_sched_target_init(LPFCSCSITARGET_t *, uint16_t);
 void lpfc_sched_lun_init(LPFCSCSILUN_t *, uint16_t);

Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_ct.o

lpfc_els.c +4 -1
diff -urp lpfcdriver-2.6-8.0.3/lpfc_els.c lpfcdriver-2.6-8.0.3.hch/lpfc_els.c
@@ -70,6 +70,9 @@ static int lpfc_issue_els_flogi(struct l
 				uint8_t);
 static void lpfc_more_plogi(struct lpfc_hba *);
 static void lpfc_more_adisc(struct lpfc_hba *);
+static struct lpfc_iocbq *lpfc_prep_els_iocb(struct lpfc_hba * phba,
+		uint8_t expectRsp, uint16_t cmdSize, uint8_t retry,
+		struct lpfc_nodelist * ndlp, uint32_t elscmd);
 
 static int lpfc_max_els_tries = 3;
 
@@ -1408,7 +1411,7 @@ lpfc_els_retry(struct lpfc_hba * phba, s
 	return (0);
 }
 
-struct lpfc_iocbq *
+static struct lpfc_iocbq *
 lpfc_prep_els_iocb(struct lpfc_hba * phba,
 		   uint8_t expectRsp,
 		   uint16_t cmdSize,

Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_els.o

lpfc_fcp.c +0 -48

51 lines not on this page · raw message

Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_fcp.o

lpfc_hbadisc.c +1 -179

192 lines not on this page · raw message

Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_hbadisc.o

lpfc_init.c +4 -2
diff -urp lpfcdriver-2.6-8.0.3/lpfc_init.c lpfcdriver-2.6-8.0.3.hch/lpfc_init.c
@@ -47,6 +47,8 @@ static int lpfc_post_rcv_buf(struct lpfc
 static void lpfc_establish_link_tmo(unsigned long ptr);
 static int lpfc_check_for_vpd = 1;
 static int lpfc_rdrev_wd30 = 0;
+static int lpfc_online(struct lpfc_hba * phba);
+static int lpfc_offline(struct lpfc_hba * phba);
 
 
 /************************************************************************/
@@ -1152,7 +1154,7 @@ lpfc_establish_link_tmo(unsigned long pt
 	spin_unlock_irqrestore(&(phba->drvrlock), iflag);
 }
 
-int
+static int
 lpfc_online(struct lpfc_hba * phba)
 {
 	uint32_t timeout;
@@ -1198,7 +1200,7 @@ lpfc_online(struct lpfc_hba * phba)
 	return (0);
 }
 
-int
+static int
 lpfc_offline(struct lpfc_hba * phba)
 {
 	struct lpfc_sli_ring *pring;

Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_init.o

lpfc_logmsg.c +0 -84

96 lines not on this page · raw message

Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_logmsg.o Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_mbox.o Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_mem.o

lpfc_nportdisc.c +2 -0
diff -urp lpfcdriver-2.6-8.0.3/lpfc_nportdisc.c lpfcdriver-2.6-8.0.3.hch/lpfc_nportdisc.c
@@ -44,6 +44,8 @@
 extern uint8_t lpfcAlpaArray[];
 
 int lpfc_geportname(struct lpfc_name *, struct lpfc_name *);
+static struct lpfc_bindlist *lpfc_assign_scsid(struct lpfc_hba * phba,
+		struct lpfc_nodelist * ndlp, int prev_flag);
 
 
 static int

Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_nportdisc.o

lpfc_scsiport.c +2 -2
diff -urp lpfcdriver-2.6-8.0.3/lpfc_scsiport.c lpfcdriver-2.6-8.0.3.hch/lpfc_scsiport.c
@@ -518,7 +518,7 @@ lpfc_scsi_cmd_abort(struct lpfc_hba * ph
 
 }
 
-int
+static int
 lpfc_scsi_lun_reset(LPFC_SCSI_BUF_t * lpfc_cmd, 
 		    struct lpfc_hba *phba, uint32_t flag)
 {
@@ -623,7 +623,7 @@ lpfc_scsi_lun_reset(LPFC_SCSI_BUF_t * lp
 
 }
 
-int
+static int
 lpfc_scsi_tgt_reset(LPFC_SCSI_BUF_t * lpfc_cmd,
 		    struct lpfc_hba * phba, uint32_t flag)
 {

Only in lpfcdriver-2.6-8.0.3.hch/: lpfc_scsiport.o

lpfc_sli.c +2 -100

123 lines not on this page · raw message