Commit 47975477 authored by Adrian Bunk's avatar Adrian Bunk Committed by James Bottomley

[SCSI] qla4xxx: possible cleanups

- make needlessly global code static
- #if 0 unused functions
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Acked-by: default avatarRavi Anand <ravi.anand@qlogic.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 15061f23
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include "ql4_def.h" #include "ql4_def.h"
#include <scsi/scsi_dbg.h> #include <scsi/scsi_dbg.h>
#if 0
static void qla4xxx_print_srb_info(struct srb * srb) static void qla4xxx_print_srb_info(struct srb * srb)
{ {
printk("%s: srb = 0x%p, flags=0x%02x\n", __func__, srb, srb->flags); printk("%s: srb = 0x%p, flags=0x%02x\n", __func__, srb, srb->flags);
...@@ -195,3 +197,5 @@ void qla4xxx_dump_buffer(void *b, uint32_t size) ...@@ -195,3 +197,5 @@ void qla4xxx_dump_buffer(void *b, uint32_t size)
if (cnt % 16) if (cnt % 16)
printk(KERN_DEBUG "\n"); printk(KERN_DEBUG "\n");
} }
#endif /* 0 */
...@@ -43,8 +43,6 @@ int qla4xxx_get_fwddb_entry(struct scsi_qla_host *ha, ...@@ -43,8 +43,6 @@ int qla4xxx_get_fwddb_entry(struct scsi_qla_host *ha,
uint16_t *tcp_source_port_num, uint16_t *tcp_source_port_num,
uint16_t *connection_id); uint16_t *connection_id);
struct ddb_entry * qla4xxx_alloc_ddb(struct scsi_qla_host * ha,
uint32_t fw_ddb_index);
int qla4xxx_set_ddb_entry(struct scsi_qla_host * ha, uint16_t fw_ddb_index, int qla4xxx_set_ddb_entry(struct scsi_qla_host * ha, uint16_t fw_ddb_index,
dma_addr_t fw_ddb_entry_dma); dma_addr_t fw_ddb_entry_dma);
...@@ -55,18 +53,11 @@ void qla4xxx_get_crash_record(struct scsi_qla_host * ha); ...@@ -55,18 +53,11 @@ void qla4xxx_get_crash_record(struct scsi_qla_host * ha);
struct ddb_entry *qla4xxx_alloc_sess(struct scsi_qla_host *ha); struct ddb_entry *qla4xxx_alloc_sess(struct scsi_qla_host *ha);
int qla4xxx_add_sess(struct ddb_entry *); int qla4xxx_add_sess(struct ddb_entry *);
void qla4xxx_destroy_sess(struct ddb_entry *ddb_entry); void qla4xxx_destroy_sess(struct ddb_entry *ddb_entry);
int qla4xxx_conn_close_sess_logout(struct scsi_qla_host * ha,
uint16_t fw_ddb_index,
uint16_t connection_id,
uint16_t option);
int qla4xxx_clear_database_entry(struct scsi_qla_host * ha,
uint16_t fw_ddb_index);
int qla4xxx_is_nvram_configuration_valid(struct scsi_qla_host * ha); int qla4xxx_is_nvram_configuration_valid(struct scsi_qla_host * ha);
int qla4xxx_get_fw_version(struct scsi_qla_host * ha); int qla4xxx_get_fw_version(struct scsi_qla_host * ha);
void qla4xxx_interrupt_service_routine(struct scsi_qla_host * ha, void qla4xxx_interrupt_service_routine(struct scsi_qla_host * ha,
uint32_t intr_status); uint32_t intr_status);
int qla4xxx_init_rings(struct scsi_qla_host * ha); int qla4xxx_init_rings(struct scsi_qla_host * ha);
void qla4xxx_dump_buffer(void *b, uint32_t size);
struct srb * qla4xxx_del_from_active_array(struct scsi_qla_host *ha, uint32_t index); struct srb * qla4xxx_del_from_active_array(struct scsi_qla_host *ha, uint32_t index);
void qla4xxx_srb_compl(struct scsi_qla_host *ha, struct srb *srb); void qla4xxx_srb_compl(struct scsi_qla_host *ha, struct srb *srb);
int qla4xxx_reinitialize_ddb_list(struct scsi_qla_host * ha); int qla4xxx_reinitialize_ddb_list(struct scsi_qla_host * ha);
......
...@@ -7,9 +7,8 @@ ...@@ -7,9 +7,8 @@
#include "ql4_def.h" #include "ql4_def.h"
/* static struct ddb_entry * qla4xxx_alloc_ddb(struct scsi_qla_host *ha,
* QLogic ISP4xxx Hardware Support Function Prototypes. uint32_t fw_ddb_index);
*/
static void ql4xxx_set_mac_number(struct scsi_qla_host *ha) static void ql4xxx_set_mac_number(struct scsi_qla_host *ha)
{ {
...@@ -48,7 +47,8 @@ static void ql4xxx_set_mac_number(struct scsi_qla_host *ha) ...@@ -48,7 +47,8 @@ static void ql4xxx_set_mac_number(struct scsi_qla_host *ha)
* This routine deallocates and unlinks the specified ddb_entry from the * This routine deallocates and unlinks the specified ddb_entry from the
* adapter's * adapter's
**/ **/
void qla4xxx_free_ddb(struct scsi_qla_host *ha, struct ddb_entry *ddb_entry) static void qla4xxx_free_ddb(struct scsi_qla_host *ha,
struct ddb_entry *ddb_entry)
{ {
/* Remove device entry from list */ /* Remove device entry from list */
list_del_init(&ddb_entry->list); list_del_init(&ddb_entry->list);
...@@ -370,9 +370,9 @@ static struct ddb_entry* qla4xxx_get_ddb_entry(struct scsi_qla_host *ha, ...@@ -370,9 +370,9 @@ static struct ddb_entry* qla4xxx_get_ddb_entry(struct scsi_qla_host *ha,
* must be initialized prior to calling this routine * must be initialized prior to calling this routine
* *
**/ **/
int qla4xxx_update_ddb_entry(struct scsi_qla_host *ha, static int qla4xxx_update_ddb_entry(struct scsi_qla_host *ha,
struct ddb_entry *ddb_entry, struct ddb_entry *ddb_entry,
uint32_t fw_ddb_index) uint32_t fw_ddb_index)
{ {
struct dev_db_entry *fw_ddb_entry = NULL; struct dev_db_entry *fw_ddb_entry = NULL;
dma_addr_t fw_ddb_entry_dma; dma_addr_t fw_ddb_entry_dma;
...@@ -450,8 +450,8 @@ int qla4xxx_update_ddb_entry(struct scsi_qla_host *ha, ...@@ -450,8 +450,8 @@ int qla4xxx_update_ddb_entry(struct scsi_qla_host *ha,
* This routine allocates a ddb_entry, ititializes some values, and * This routine allocates a ddb_entry, ititializes some values, and
* inserts it into the ddb list. * inserts it into the ddb list.
**/ **/
struct ddb_entry * qla4xxx_alloc_ddb(struct scsi_qla_host *ha, static struct ddb_entry * qla4xxx_alloc_ddb(struct scsi_qla_host *ha,
uint32_t fw_ddb_index) uint32_t fw_ddb_index)
{ {
struct ddb_entry *ddb_entry; struct ddb_entry *ddb_entry;
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
* - advances the request_in pointer * - advances the request_in pointer
* - checks for queue full * - checks for queue full
**/ **/
int qla4xxx_get_req_pkt(struct scsi_qla_host *ha, static int qla4xxx_get_req_pkt(struct scsi_qla_host *ha,
struct queue_entry **queue_entry) struct queue_entry **queue_entry)
{ {
uint16_t request_in; uint16_t request_in;
uint8_t status = QLA_SUCCESS; uint8_t status = QLA_SUCCESS;
...@@ -62,8 +62,8 @@ int qla4xxx_get_req_pkt(struct scsi_qla_host *ha, ...@@ -62,8 +62,8 @@ int qla4xxx_get_req_pkt(struct scsi_qla_host *ha,
* *
* This routine issues a marker IOCB. * This routine issues a marker IOCB.
**/ **/
int qla4xxx_send_marker_iocb(struct scsi_qla_host *ha, static int qla4xxx_send_marker_iocb(struct scsi_qla_host *ha,
struct ddb_entry *ddb_entry, int lun) struct ddb_entry *ddb_entry, int lun)
{ {
struct marker_entry *marker_entry; struct marker_entry *marker_entry;
unsigned long flags = 0; unsigned long flags = 0;
...@@ -96,7 +96,7 @@ int qla4xxx_send_marker_iocb(struct scsi_qla_host *ha, ...@@ -96,7 +96,7 @@ int qla4xxx_send_marker_iocb(struct scsi_qla_host *ha,
return status; return status;
} }
struct continuation_t1_entry* qla4xxx_alloc_cont_entry( static struct continuation_t1_entry* qla4xxx_alloc_cont_entry(
struct scsi_qla_host *ha) struct scsi_qla_host *ha)
{ {
struct continuation_t1_entry *cont_entry; struct continuation_t1_entry *cont_entry;
...@@ -120,7 +120,7 @@ struct continuation_t1_entry* qla4xxx_alloc_cont_entry( ...@@ -120,7 +120,7 @@ struct continuation_t1_entry* qla4xxx_alloc_cont_entry(
return cont_entry; return cont_entry;
} }
uint16_t qla4xxx_calc_request_entries(uint16_t dsds) static uint16_t qla4xxx_calc_request_entries(uint16_t dsds)
{ {
uint16_t iocbs; uint16_t iocbs;
...@@ -133,9 +133,9 @@ uint16_t qla4xxx_calc_request_entries(uint16_t dsds) ...@@ -133,9 +133,9 @@ uint16_t qla4xxx_calc_request_entries(uint16_t dsds)
return iocbs; return iocbs;
} }
void qla4xxx_build_scsi_iocbs(struct srb *srb, static void qla4xxx_build_scsi_iocbs(struct srb *srb,
struct command_t3_entry *cmd_entry, struct command_t3_entry *cmd_entry,
uint16_t tot_dsds) uint16_t tot_dsds)
{ {
struct scsi_qla_host *ha; struct scsi_qla_host *ha;
uint16_t avail_dsds; uint16_t avail_dsds;
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
* If outCount is 0, this routine completes successfully WITHOUT waiting * If outCount is 0, this routine completes successfully WITHOUT waiting
* for the mailbox command to complete. * for the mailbox command to complete.
**/ **/
int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount, static int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount,
uint8_t outCount, uint32_t *mbx_cmd, uint8_t outCount, uint32_t *mbx_cmd,
uint32_t *mbx_sts) uint32_t *mbx_sts)
{ {
int status = QLA_ERROR; int status = QLA_ERROR;
uint8_t i; uint8_t i;
...@@ -170,6 +170,8 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount, ...@@ -170,6 +170,8 @@ int qla4xxx_mailbox_command(struct scsi_qla_host *ha, uint8_t inCount,
} }
#if 0
/** /**
* qla4xxx_issue_iocb - issue mailbox iocb command * qla4xxx_issue_iocb - issue mailbox iocb command
* @ha: adapter state pointer. * @ha: adapter state pointer.
...@@ -243,6 +245,8 @@ int qla4xxx_clear_database_entry(struct scsi_qla_host * ha, ...@@ -243,6 +245,8 @@ int qla4xxx_clear_database_entry(struct scsi_qla_host * ha,
return QLA_SUCCESS; return QLA_SUCCESS;
} }
#endif /* 0 */
/** /**
* qla4xxx_initialize_fw_cb - initializes firmware control block. * qla4xxx_initialize_fw_cb - initializes firmware control block.
* @ha: Pointer to host adapter structure. * @ha: Pointer to host adapter structure.
...@@ -570,6 +574,7 @@ int qla4xxx_set_ddb_entry(struct scsi_qla_host * ha, uint16_t fw_ddb_index, ...@@ -570,6 +574,7 @@ int qla4xxx_set_ddb_entry(struct scsi_qla_host * ha, uint16_t fw_ddb_index,
return qla4xxx_mailbox_command(ha, 4, 1, &mbox_cmd[0], &mbox_sts[0]); return qla4xxx_mailbox_command(ha, 4, 1, &mbox_cmd[0], &mbox_sts[0]);
} }
#if 0
int qla4xxx_conn_open_session_login(struct scsi_qla_host * ha, int qla4xxx_conn_open_session_login(struct scsi_qla_host * ha,
uint16_t fw_ddb_index) uint16_t fw_ddb_index)
{ {
...@@ -594,6 +599,7 @@ int qla4xxx_conn_open_session_login(struct scsi_qla_host * ha, ...@@ -594,6 +599,7 @@ int qla4xxx_conn_open_session_login(struct scsi_qla_host * ha,
return status; return status;
} }
#endif /* 0 */
/** /**
* qla4xxx_get_crash_record - retrieves crash record. * qla4xxx_get_crash_record - retrieves crash record.
...@@ -649,6 +655,7 @@ void qla4xxx_get_crash_record(struct scsi_qla_host * ha) ...@@ -649,6 +655,7 @@ void qla4xxx_get_crash_record(struct scsi_qla_host * ha)
crash_record, crash_record_dma); crash_record, crash_record_dma);
} }
#if 0
/** /**
* qla4xxx_get_conn_event_log - retrieves connection event log * qla4xxx_get_conn_event_log - retrieves connection event log
* @ha: Pointer to host adapter structure. * @ha: Pointer to host adapter structure.
...@@ -738,6 +745,7 @@ void qla4xxx_get_conn_event_log(struct scsi_qla_host * ha) ...@@ -738,6 +745,7 @@ void qla4xxx_get_conn_event_log(struct scsi_qla_host * ha)
dma_free_coherent(&ha->pdev->dev, event_log_size, event_log, dma_free_coherent(&ha->pdev->dev, event_log_size, event_log,
event_log_dma); event_log_dma);
} }
#endif /* 0 */
/** /**
* qla4xxx_reset_lun - issues LUN Reset * qla4xxx_reset_lun - issues LUN Reset
...@@ -834,7 +842,8 @@ int qla4xxx_get_fw_version(struct scsi_qla_host * ha) ...@@ -834,7 +842,8 @@ int qla4xxx_get_fw_version(struct scsi_qla_host * ha)
return QLA_SUCCESS; return QLA_SUCCESS;
} }
int qla4xxx_get_default_ddb(struct scsi_qla_host *ha, dma_addr_t dma_addr) static int qla4xxx_get_default_ddb(struct scsi_qla_host *ha,
dma_addr_t dma_addr)
{ {
uint32_t mbox_cmd[MBOX_REG_COUNT]; uint32_t mbox_cmd[MBOX_REG_COUNT];
uint32_t mbox_sts[MBOX_REG_COUNT]; uint32_t mbox_sts[MBOX_REG_COUNT];
...@@ -855,7 +864,7 @@ int qla4xxx_get_default_ddb(struct scsi_qla_host *ha, dma_addr_t dma_addr) ...@@ -855,7 +864,7 @@ int qla4xxx_get_default_ddb(struct scsi_qla_host *ha, dma_addr_t dma_addr)
return QLA_SUCCESS; return QLA_SUCCESS;
} }
int qla4xxx_req_ddb_entry(struct scsi_qla_host *ha, uint32_t *ddb_index) static int qla4xxx_req_ddb_entry(struct scsi_qla_host *ha, uint32_t *ddb_index)
{ {
uint32_t mbox_cmd[MBOX_REG_COUNT]; uint32_t mbox_cmd[MBOX_REG_COUNT];
uint32_t mbox_sts[MBOX_REG_COUNT]; uint32_t mbox_sts[MBOX_REG_COUNT];
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
/* /*
* Driver version * Driver version
*/ */
char qla4xxx_version_str[40]; static char qla4xxx_version_str[40];
/* /*
* SRB allocation cache * SRB allocation cache
...@@ -45,8 +45,7 @@ int ql4_mod_unload = 0; ...@@ -45,8 +45,7 @@ int ql4_mod_unload = 0;
/* /*
* SCSI host template entry points * SCSI host template entry points
*/ */
static void qla4xxx_config_dma_addressing(struct scsi_qla_host *ha);
void qla4xxx_config_dma_addressing(struct scsi_qla_host *ha);
/* /*
* iSCSI template entry points * iSCSI template entry points
...@@ -1352,7 +1351,7 @@ static void __devexit qla4xxx_remove_adapter(struct pci_dev *pdev) ...@@ -1352,7 +1351,7 @@ static void __devexit qla4xxx_remove_adapter(struct pci_dev *pdev)
* At exit, the @ha's flags.enable_64bit_addressing set to indicated * At exit, the @ha's flags.enable_64bit_addressing set to indicated
* supported addressing method. * supported addressing method.
*/ */
void qla4xxx_config_dma_addressing(struct scsi_qla_host *ha) static void qla4xxx_config_dma_addressing(struct scsi_qla_host *ha)
{ {
int retval; int retval;
...@@ -1627,7 +1626,7 @@ static struct pci_device_id qla4xxx_pci_tbl[] = { ...@@ -1627,7 +1626,7 @@ static struct pci_device_id qla4xxx_pci_tbl[] = {
}; };
MODULE_DEVICE_TABLE(pci, qla4xxx_pci_tbl); MODULE_DEVICE_TABLE(pci, qla4xxx_pci_tbl);
struct pci_driver qla4xxx_pci_driver = { static struct pci_driver qla4xxx_pci_driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.id_table = qla4xxx_pci_tbl, .id_table = qla4xxx_pci_tbl,
.probe = qla4xxx_probe_adapter, .probe = qla4xxx_probe_adapter,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment