diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2010-02-26 17:01:42 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2010-02-28 13:42:32 -0500 |
commit | aad9fb6f2c5beafe76a724c90a4bd0d695ab8b42 (patch) | |
tree | 811a687fc986084fbdf974a31fc2226ad759cd46 /drivers | |
parent | d45033ef56fa9b09b73a6eb2a0f280fa7c1bab09 (diff) |
cciss: do not use void pointer for scsi hba data
cciss: do not use void pointer for scsi hba data
and get rid of related unnecessary type casting
and delete some superfluous and misleading comments nearby.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/cciss.h | 4 | ||||
-rw-r--r-- | drivers/block/cciss_scsi.c | 23 |
2 files changed, 11 insertions, 16 deletions
diff --git a/drivers/block/cciss.h b/drivers/block/cciss.h index ac454fdd4d30..c5d411174db0 100644 --- a/drivers/block/cciss.h +++ b/drivers/block/cciss.h | |||
@@ -131,9 +131,7 @@ struct ctlr_info | |||
131 | /* Disk structures we need to pass back */ | 131 | /* Disk structures we need to pass back */ |
132 | struct gendisk *gendisk[CISS_MAX_LUN]; | 132 | struct gendisk *gendisk[CISS_MAX_LUN]; |
133 | #ifdef CONFIG_CISS_SCSI_TAPE | 133 | #ifdef CONFIG_CISS_SCSI_TAPE |
134 | void *scsi_ctlr; /* ptr to structure containing scsi related stuff */ | 134 | struct cciss_scsi_adapter_data_t *scsi_ctlr; |
135 | /* list of block side commands the scsi error handling sucked up */ | ||
136 | /* and saved for later processing */ | ||
137 | #endif | 135 | #endif |
138 | unsigned char alive; | 136 | unsigned char alive; |
139 | struct list_head scan_list; | 137 | struct list_head scan_list; |
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index f203606faaff..c4582323a07d 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c | |||
@@ -127,11 +127,9 @@ struct cciss_scsi_adapter_data_t { | |||
127 | }; | 127 | }; |
128 | 128 | ||
129 | #define CPQ_TAPE_LOCK(ctlr, flags) spin_lock_irqsave( \ | 129 | #define CPQ_TAPE_LOCK(ctlr, flags) spin_lock_irqsave( \ |
130 | &(((struct cciss_scsi_adapter_data_t *) \ | 130 | &hba[ctlr]->scsi_ctlr->lock, flags); |
131 | hba[ctlr]->scsi_ctlr)->lock), flags); | ||
132 | #define CPQ_TAPE_UNLOCK(ctlr, flags) spin_unlock_irqrestore( \ | 131 | #define CPQ_TAPE_UNLOCK(ctlr, flags) spin_unlock_irqrestore( \ |
133 | &(((struct cciss_scsi_adapter_data_t *) \ | 132 | &hba[ctlr]->scsi_ctlr->lock, flags); |
134 | hba[ctlr]->scsi_ctlr)->lock), flags); | ||
135 | 133 | ||
136 | static CommandList_struct * | 134 | static CommandList_struct * |
137 | scsi_cmd_alloc(ctlr_info_t *h) | 135 | scsi_cmd_alloc(ctlr_info_t *h) |
@@ -147,7 +145,7 @@ scsi_cmd_alloc(ctlr_info_t *h) | |||
147 | struct cciss_scsi_cmd_stack_t *stk; | 145 | struct cciss_scsi_cmd_stack_t *stk; |
148 | u64bit temp64; | 146 | u64bit temp64; |
149 | 147 | ||
150 | sa = (struct cciss_scsi_adapter_data_t *) h->scsi_ctlr; | 148 | sa = h->scsi_ctlr; |
151 | stk = &sa->cmd_stack; | 149 | stk = &sa->cmd_stack; |
152 | 150 | ||
153 | if (stk->top < 0) | 151 | if (stk->top < 0) |
@@ -186,7 +184,7 @@ scsi_cmd_free(ctlr_info_t *h, CommandList_struct *cmd) | |||
186 | struct cciss_scsi_adapter_data_t *sa; | 184 | struct cciss_scsi_adapter_data_t *sa; |
187 | struct cciss_scsi_cmd_stack_t *stk; | 185 | struct cciss_scsi_cmd_stack_t *stk; |
188 | 186 | ||
189 | sa = (struct cciss_scsi_adapter_data_t *) h->scsi_ctlr; | 187 | sa = h->scsi_ctlr; |
190 | stk = &sa->cmd_stack; | 188 | stk = &sa->cmd_stack; |
191 | if (stk->top >= CMD_STACK_SIZE) { | 189 | if (stk->top >= CMD_STACK_SIZE) { |
192 | printk("cciss: scsi_cmd_free called too many times.\n"); | 190 | printk("cciss: scsi_cmd_free called too many times.\n"); |
@@ -233,7 +231,7 @@ scsi_cmd_stack_free(int ctlr) | |||
233 | struct cciss_scsi_cmd_stack_t *stk; | 231 | struct cciss_scsi_cmd_stack_t *stk; |
234 | size_t size; | 232 | size_t size; |
235 | 233 | ||
236 | sa = (struct cciss_scsi_adapter_data_t *) hba[ctlr]->scsi_ctlr; | 234 | sa = hba[ctlr]->scsi_ctlr; |
237 | stk = &sa->cmd_stack; | 235 | stk = &sa->cmd_stack; |
238 | if (stk->top != CMD_STACK_SIZE-1) { | 236 | if (stk->top != CMD_STACK_SIZE-1) { |
239 | printk( "cciss: %d scsi commands are still outstanding.\n", | 237 | printk( "cciss: %d scsi commands are still outstanding.\n", |
@@ -534,8 +532,7 @@ adjust_cciss_scsi_table(int ctlr, int hostno, | |||
534 | CPQ_TAPE_LOCK(ctlr, flags); | 532 | CPQ_TAPE_LOCK(ctlr, flags); |
535 | 533 | ||
536 | if (hostno != -1) /* if it's not the first time... */ | 534 | if (hostno != -1) /* if it's not the first time... */ |
537 | sh = ((struct cciss_scsi_adapter_data_t *) | 535 | sh = hba[ctlr]->scsi_ctlr->scsi_host; |
538 | hba[ctlr]->scsi_ctlr)->scsi_host; | ||
539 | 536 | ||
540 | /* find any devices in ccissscsi[] that are not in | 537 | /* find any devices in ccissscsi[] that are not in |
541 | sd[] and remove them from ccissscsi[] */ | 538 | sd[] and remove them from ccissscsi[] */ |
@@ -706,7 +703,7 @@ cciss_scsi_setup(int cntl_num) | |||
706 | kfree(shba); | 703 | kfree(shba); |
707 | shba = NULL; | 704 | shba = NULL; |
708 | } | 705 | } |
709 | hba[cntl_num]->scsi_ctlr = (void *) shba; | 706 | hba[cntl_num]->scsi_ctlr = shba; |
710 | return; | 707 | return; |
711 | } | 708 | } |
712 | 709 | ||
@@ -853,7 +850,7 @@ cciss_scsi_detect(int ctlr) | |||
853 | sh->this_id = SELF_SCSI_ID; | 850 | sh->this_id = SELF_SCSI_ID; |
854 | 851 | ||
855 | ((struct cciss_scsi_adapter_data_t *) | 852 | ((struct cciss_scsi_adapter_data_t *) |
856 | hba[ctlr]->scsi_ctlr)->scsi_host = (void *) sh; | 853 | hba[ctlr]->scsi_ctlr)->scsi_host = sh; |
857 | sh->hostdata[0] = (unsigned long) hba[ctlr]; | 854 | sh->hostdata[0] = (unsigned long) hba[ctlr]; |
858 | sh->irq = hba[ctlr]->intr[SIMPLE_MODE_INT]; | 855 | sh->irq = hba[ctlr]->intr[SIMPLE_MODE_INT]; |
859 | sh->unique_id = sh->irq; | 856 | sh->unique_id = sh->irq; |
@@ -1518,7 +1515,7 @@ cciss_unregister_scsi(int ctlr) | |||
1518 | /* we are being forcibly unloaded, and may not refuse. */ | 1515 | /* we are being forcibly unloaded, and may not refuse. */ |
1519 | 1516 | ||
1520 | spin_lock_irqsave(CCISS_LOCK(ctlr), flags); | 1517 | spin_lock_irqsave(CCISS_LOCK(ctlr), flags); |
1521 | sa = (struct cciss_scsi_adapter_data_t *) hba[ctlr]->scsi_ctlr; | 1518 | sa = hba[ctlr]->scsi_ctlr; |
1522 | stk = &sa->cmd_stack; | 1519 | stk = &sa->cmd_stack; |
1523 | 1520 | ||
1524 | /* if we weren't ever actually registered, don't unregister */ | 1521 | /* if we weren't ever actually registered, don't unregister */ |
@@ -1545,7 +1542,7 @@ cciss_engage_scsi(int ctlr) | |||
1545 | unsigned long flags; | 1542 | unsigned long flags; |
1546 | 1543 | ||
1547 | spin_lock_irqsave(CCISS_LOCK(ctlr), flags); | 1544 | spin_lock_irqsave(CCISS_LOCK(ctlr), flags); |
1548 | sa = (struct cciss_scsi_adapter_data_t *) hba[ctlr]->scsi_ctlr; | 1545 | sa = hba[ctlr]->scsi_ctlr; |
1549 | stk = &sa->cmd_stack; | 1546 | stk = &sa->cmd_stack; |
1550 | 1547 | ||
1551 | if (sa->registered) { | 1548 | if (sa->registered) { |