Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] qla4xxx: possible cleanups

- make needlessly global code static
- #if 0 unused functions

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by

Adrian Bunk and committed by
James Bottomley
47975477 15061f23

+40 -37
+4
drivers/scsi/qla4xxx/ql4_dbg.c
··· 8 8 #include "ql4_def.h" 9 9 #include <scsi/scsi_dbg.h> 10 10 11 + #if 0 12 + 11 13 static void qla4xxx_print_srb_info(struct srb * srb) 12 14 { 13 15 printk("%s: srb = 0x%p, flags=0x%02x\n", __func__, srb, srb->flags); ··· 197 195 if (cnt % 16) 198 196 printk(KERN_DEBUG "\n"); 199 197 } 198 + 199 + #endif /* 0 */
-9
drivers/scsi/qla4xxx/ql4_glbl.h
··· 43 43 uint16_t *tcp_source_port_num, 44 44 uint16_t *connection_id); 45 45 46 - struct ddb_entry * qla4xxx_alloc_ddb(struct scsi_qla_host * ha, 47 - uint32_t fw_ddb_index); 48 46 int qla4xxx_set_ddb_entry(struct scsi_qla_host * ha, uint16_t fw_ddb_index, 49 47 dma_addr_t fw_ddb_entry_dma); 50 48 ··· 53 55 struct ddb_entry *qla4xxx_alloc_sess(struct scsi_qla_host *ha); 54 56 int qla4xxx_add_sess(struct ddb_entry *); 55 57 void qla4xxx_destroy_sess(struct ddb_entry *ddb_entry); 56 - int qla4xxx_conn_close_sess_logout(struct scsi_qla_host * ha, 57 - uint16_t fw_ddb_index, 58 - uint16_t connection_id, 59 - uint16_t option); 60 - int qla4xxx_clear_database_entry(struct scsi_qla_host * ha, 61 - uint16_t fw_ddb_index); 62 58 int qla4xxx_is_nvram_configuration_valid(struct scsi_qla_host * ha); 63 59 int qla4xxx_get_fw_version(struct scsi_qla_host * ha); 64 60 void qla4xxx_interrupt_service_routine(struct scsi_qla_host * ha, 65 61 uint32_t intr_status); 66 62 int qla4xxx_init_rings(struct scsi_qla_host * ha); 67 - void qla4xxx_dump_buffer(void *b, uint32_t size); 68 63 struct srb * qla4xxx_del_from_active_array(struct scsi_qla_host *ha, uint32_t index); 69 64 void qla4xxx_srb_compl(struct scsi_qla_host *ha, struct srb *srb); 70 65 int qla4xxx_reinitialize_ddb_list(struct scsi_qla_host * ha);
+9 -9
drivers/scsi/qla4xxx/ql4_init.c
··· 7 7 8 8 #include "ql4_def.h" 9 9 10 - /* 11 - * QLogic ISP4xxx Hardware Support Function Prototypes. 12 - */ 10 + static struct ddb_entry * qla4xxx_alloc_ddb(struct scsi_qla_host *ha, 11 + uint32_t fw_ddb_index); 13 12 14 13 static void ql4xxx_set_mac_number(struct scsi_qla_host *ha) 15 14 { ··· 47 48 * This routine deallocates and unlinks the specified ddb_entry from the 48 49 * adapter's 49 50 **/ 50 - void qla4xxx_free_ddb(struct scsi_qla_host *ha, struct ddb_entry *ddb_entry) 51 + static void qla4xxx_free_ddb(struct scsi_qla_host *ha, 52 + struct ddb_entry *ddb_entry) 51 53 { 52 54 /* Remove device entry from list */ 53 55 list_del_init(&ddb_entry->list); ··· 370 370 * must be initialized prior to calling this routine 371 371 * 372 372 **/ 373 - int qla4xxx_update_ddb_entry(struct scsi_qla_host *ha, 374 - struct ddb_entry *ddb_entry, 375 - uint32_t fw_ddb_index) 373 + static int qla4xxx_update_ddb_entry(struct scsi_qla_host *ha, 374 + struct ddb_entry *ddb_entry, 375 + uint32_t fw_ddb_index) 376 376 { 377 377 struct dev_db_entry *fw_ddb_entry = NULL; 378 378 dma_addr_t fw_ddb_entry_dma; ··· 450 450 * This routine allocates a ddb_entry, ititializes some values, and 451 451 * inserts it into the ddb list. 452 452 **/ 453 - struct ddb_entry * qla4xxx_alloc_ddb(struct scsi_qla_host *ha, 454 - uint32_t fw_ddb_index) 453 + static struct ddb_entry * qla4xxx_alloc_ddb(struct scsi_qla_host *ha, 454 + uint32_t fw_ddb_index) 455 455 { 456 456 struct ddb_entry *ddb_entry; 457 457
+9 -9
drivers/scsi/qla4xxx/ql4_iocb.c
··· 19 19 * - advances the request_in pointer 20 20 * - checks for queue full 21 21 **/ 22 - int qla4xxx_get_req_pkt(struct scsi_qla_host *ha, 23 - struct queue_entry **queue_entry) 22 + static int qla4xxx_get_req_pkt(struct scsi_qla_host *ha, 23 + struct queue_entry **queue_entry) 24 24 { 25 25 uint16_t request_in; 26 26 uint8_t status = QLA_SUCCESS; ··· 62 62 * 63 63 * This routine issues a marker IOCB. 64 64 **/ 65 - int qla4xxx_send_marker_iocb(struct scsi_qla_host *ha, 66 - struct ddb_entry *ddb_entry, int lun) 65 + static int qla4xxx_send_marker_iocb(struct scsi_qla_host *ha, 66 + struct ddb_entry *ddb_entry, int lun) 67 67 { 68 68 struct marker_entry *marker_entry; 69 69 unsigned long flags = 0; ··· 96 96 return status; 97 97 } 98 98 99 - struct continuation_t1_entry* qla4xxx_alloc_cont_entry( 99 + static struct continuation_t1_entry* qla4xxx_alloc_cont_entry( 100 100 struct scsi_qla_host *ha) 101 101 { 102 102 struct continuation_t1_entry *cont_entry; ··· 120 120 return cont_entry; 121 121 } 122 122 123 - uint16_t qla4xxx_calc_request_entries(uint16_t dsds) 123 + static uint16_t qla4xxx_calc_request_entries(uint16_t dsds) 124 124 { 125 125 uint16_t iocbs; 126 126 ··· 133 133 return iocbs; 134 134 } 135 135 136 - void qla4xxx_build_scsi_iocbs(struct srb *srb, 137 - struct command_t3_entry *cmd_entry, 138 - uint16_t tot_dsds) 136 + static void qla4xxx_build_scsi_iocbs(struct srb *srb, 137 + struct command_t3_entry *cmd_entry, 138 + uint16_t tot_dsds) 139 139 { 140 140 struct scsi_qla_host *ha; 141 141 uint16_t avail_dsds;
+14 -5
drivers/scsi/qla4xxx/ql4_mbx.c
··· 20 20 * If outCount is 0, this routine completes successfully WITHOUT waiting 21 21 * for the mailbox command to complete. 22 22 **/ 23 - int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount, 24 - uint8_t outCount, uint32_t *mbx_cmd, 25 - uint32_t *mbx_sts) 23 + static int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount, 24 + uint8_t outCount, uint32_t *mbx_cmd, 25 + uint32_t *mbx_sts) 26 26 { 27 27 int status = QLA_ERROR; 28 28 uint8_t i; ··· 170 170 } 171 171 172 172 173 + #if 0 174 + 173 175 /** 174 176 * qla4xxx_issue_iocb - issue mailbox iocb command 175 177 * @ha: adapter state pointer. ··· 244 242 245 243 return QLA_SUCCESS; 246 244 } 245 + 246 + #endif /* 0 */ 247 247 248 248 /** 249 249 * qla4xxx_initialize_fw_cb - initializes firmware control block. ··· 574 570 return qla4xxx_mailbox_command(ha, 4, 1, &mbox_cmd[0], &mbox_sts[0]); 575 571 } 576 572 573 + #if 0 577 574 int qla4xxx_conn_open_session_login(struct scsi_qla_host * ha, 578 575 uint16_t fw_ddb_index) 579 576 { ··· 599 594 600 595 return status; 601 596 } 597 + #endif /* 0 */ 602 598 603 599 /** 604 600 * qla4xxx_get_crash_record - retrieves crash record. ··· 655 649 crash_record, crash_record_dma); 656 650 } 657 651 652 + #if 0 658 653 /** 659 654 * qla4xxx_get_conn_event_log - retrieves connection event log 660 655 * @ha: Pointer to host adapter structure. ··· 745 738 dma_free_coherent(&ha->pdev->dev, event_log_size, event_log, 746 739 event_log_dma); 747 740 } 741 + #endif /* 0 */ 748 742 749 743 /** 750 744 * qla4xxx_reset_lun - issues LUN Reset ··· 842 834 return QLA_SUCCESS; 843 835 } 844 836 845 - int qla4xxx_get_default_ddb(struct scsi_qla_host *ha, dma_addr_t dma_addr) 837 + static int qla4xxx_get_default_ddb(struct scsi_qla_host *ha, 838 + dma_addr_t dma_addr) 846 839 { 847 840 uint32_t mbox_cmd[MBOX_REG_COUNT]; 848 841 uint32_t mbox_sts[MBOX_REG_COUNT]; ··· 864 855 return QLA_SUCCESS; 865 856 } 866 857 867 - int qla4xxx_req_ddb_entry(struct scsi_qla_host *ha, uint32_t *ddb_index) 858 + static int qla4xxx_req_ddb_entry(struct scsi_qla_host *ha, uint32_t *ddb_index) 868 859 { 869 860 uint32_t mbox_cmd[MBOX_REG_COUNT]; 870 861 uint32_t mbox_sts[MBOX_REG_COUNT];
+4 -5
drivers/scsi/qla4xxx/ql4_os.c
··· 14 14 /* 15 15 * Driver version 16 16 */ 17 - char qla4xxx_version_str[40]; 17 + static char qla4xxx_version_str[40]; 18 18 19 19 /* 20 20 * SRB allocation cache ··· 45 45 /* 46 46 * SCSI host template entry points 47 47 */ 48 - 49 - void qla4xxx_config_dma_addressing(struct scsi_qla_host *ha); 48 + static void qla4xxx_config_dma_addressing(struct scsi_qla_host *ha); 50 49 51 50 /* 52 51 * iSCSI template entry points ··· 1351 1352 * At exit, the @ha's flags.enable_64bit_addressing set to indicated 1352 1353 * supported addressing method. 1353 1354 */ 1354 - void qla4xxx_config_dma_addressing(struct scsi_qla_host *ha) 1355 + static void qla4xxx_config_dma_addressing(struct scsi_qla_host *ha) 1355 1356 { 1356 1357 int retval; 1357 1358 ··· 1626 1627 }; 1627 1628 MODULE_DEVICE_TABLE(pci, qla4xxx_pci_tbl); 1628 1629 1629 - struct pci_driver qla4xxx_pci_driver = { 1630 + static struct pci_driver qla4xxx_pci_driver = { 1630 1631 .name = DRIVER_NAME, 1631 1632 .id_table = qla4xxx_pci_tbl, 1632 1633 .probe = qla4xxx_probe_adapter,