summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aha152x.c
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2018-06-13 03:53:47 -0400
committerMartin K. Petersen <martin.petersen@oracle.com>2018-06-19 22:02:25 -0400
commit91ebc1facd7797d799a4c9208cb7fdc8d86e0bb4 (patch)
tree4f1ce9623e8db1182aeb82308a79337b6c0b32bc /drivers/scsi/aha152x.c
parentaa154ea885eb0c2407457ce9c1538d78c95456fa (diff)
scsi: core: remove Scsi_Cmnd typedef
This will make subsequent refactoring easier to handle. Note: this patch is nowhere checkpatch clean. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/aha152x.c')
-rw-r--r--drivers/scsi/aha152x.c71
1 files changed, 38 insertions, 33 deletions
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index bc0058df31c6..4d7b0e0adbf7 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -422,16 +422,16 @@ enum aha152x_state {
422 * 422 *
423 */ 423 */
424struct aha152x_hostdata { 424struct aha152x_hostdata {
425 Scsi_Cmnd *issue_SC; 425 struct scsi_cmnd *issue_SC;
426 /* pending commands to issue */ 426 /* pending commands to issue */
427 427
428 Scsi_Cmnd *current_SC; 428 struct scsi_cmnd *current_SC;
429 /* current command on the bus */ 429 /* current command on the bus */
430 430
431 Scsi_Cmnd *disconnected_SC; 431 struct scsi_cmnd *disconnected_SC;
432 /* commands that disconnected */ 432 /* commands that disconnected */
433 433
434 Scsi_Cmnd *done_SC; 434 struct scsi_cmnd *done_SC;
435 /* command that was completed */ 435 /* command that was completed */
436 436
437 spinlock_t lock; 437 spinlock_t lock;
@@ -510,7 +510,7 @@ struct aha152x_hostdata {
510 * 510 *
511 */ 511 */
512struct aha152x_scdata { 512struct aha152x_scdata {
513 Scsi_Cmnd *next; /* next sc in queue */ 513 struct scsi_cmnd *next; /* next sc in queue */
514 struct completion *done;/* semaphore to block on */ 514 struct completion *done;/* semaphore to block on */
515 struct scsi_eh_save ses; 515 struct scsi_eh_save ses;
516}; 516};
@@ -633,7 +633,7 @@ static void aha152x_error(struct Scsi_Host *shpnt, char *msg);
633static void done(struct Scsi_Host *shpnt, int error); 633static void done(struct Scsi_Host *shpnt, int error);
634 634
635/* diagnostics */ 635/* diagnostics */
636static void show_command(Scsi_Cmnd * ptr); 636static void show_command(struct scsi_cmnd * ptr);
637static void show_queues(struct Scsi_Host *shpnt); 637static void show_queues(struct Scsi_Host *shpnt);
638static void disp_enintr(struct Scsi_Host *shpnt); 638static void disp_enintr(struct Scsi_Host *shpnt);
639 639
@@ -642,9 +642,9 @@ static void disp_enintr(struct Scsi_Host *shpnt);
642 * queue services: 642 * queue services:
643 * 643 *
644 */ 644 */
645static inline void append_SC(Scsi_Cmnd **SC, Scsi_Cmnd *new_SC) 645static inline void append_SC(struct scsi_cmnd **SC, struct scsi_cmnd *new_SC)
646{ 646{
647 Scsi_Cmnd *end; 647 struct scsi_cmnd *end;
648 648
649 SCNEXT(new_SC) = NULL; 649 SCNEXT(new_SC) = NULL;
650 if (!*SC) 650 if (!*SC)
@@ -656,9 +656,9 @@ static inline void append_SC(Scsi_Cmnd **SC, Scsi_Cmnd *new_SC)
656 } 656 }
657} 657}
658 658
659static inline Scsi_Cmnd *remove_first_SC(Scsi_Cmnd ** SC) 659static inline struct scsi_cmnd *remove_first_SC(struct scsi_cmnd ** SC)
660{ 660{
661 Scsi_Cmnd *ptr; 661 struct scsi_cmnd *ptr;
662 662
663 ptr = *SC; 663 ptr = *SC;
664 if (ptr) { 664 if (ptr) {
@@ -668,9 +668,10 @@ static inline Scsi_Cmnd *remove_first_SC(Scsi_Cmnd ** SC)
668 return ptr; 668 return ptr;
669} 669}
670 670
671static inline Scsi_Cmnd *remove_lun_SC(Scsi_Cmnd ** SC, int target, int lun) 671static inline struct scsi_cmnd *remove_lun_SC(struct scsi_cmnd ** SC,
672 int target, int lun)
672{ 673{
673 Scsi_Cmnd *ptr, *prev; 674 struct scsi_cmnd *ptr, *prev;
674 675
675 for (ptr = *SC, prev = NULL; 676 for (ptr = *SC, prev = NULL;
676 ptr && ((ptr->device->id != target) || (ptr->device->lun != lun)); 677 ptr && ((ptr->device->id != target) || (ptr->device->lun != lun));
@@ -689,9 +690,10 @@ static inline Scsi_Cmnd *remove_lun_SC(Scsi_Cmnd ** SC, int target, int lun)
689 return ptr; 690 return ptr;
690} 691}
691 692
692static inline Scsi_Cmnd *remove_SC(Scsi_Cmnd **SC, Scsi_Cmnd *SCp) 693static inline struct scsi_cmnd *remove_SC(struct scsi_cmnd **SC,
694 struct scsi_cmnd *SCp)
693{ 695{
694 Scsi_Cmnd *ptr, *prev; 696 struct scsi_cmnd *ptr, *prev;
695 697
696 for (ptr = *SC, prev = NULL; 698 for (ptr = *SC, prev = NULL;
697 ptr && SCp!=ptr; 699 ptr && SCp!=ptr;
@@ -912,8 +914,9 @@ static int setup_expected_interrupts(struct Scsi_Host *shpnt)
912/* 914/*
913 * Queue a command and setup interrupts for a free bus. 915 * Queue a command and setup interrupts for a free bus.
914 */ 916 */
915static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete, 917static int aha152x_internal_queue(struct scsi_cmnd *SCpnt,
916 int phase, void (*done)(Scsi_Cmnd *)) 918 struct completion *complete,
919 int phase, void (*done)(struct scsi_cmnd *))
917{ 920{
918 struct Scsi_Host *shpnt = SCpnt->device->host; 921 struct Scsi_Host *shpnt = SCpnt->device->host;
919 unsigned long flags; 922 unsigned long flags;
@@ -987,7 +990,8 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete,
987 * queue a command 990 * queue a command
988 * 991 *
989 */ 992 */
990static int aha152x_queue_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) 993static int aha152x_queue_lck(struct scsi_cmnd *SCpnt,
994 void (*done)(struct scsi_cmnd *))
991{ 995{
992 return aha152x_internal_queue(SCpnt, NULL, 0, done); 996 return aha152x_internal_queue(SCpnt, NULL, 0, done);
993} 997}
@@ -998,7 +1002,7 @@ static DEF_SCSI_QCMD(aha152x_queue)
998/* 1002/*
999 * 1003 *
1000 */ 1004 */
1001static void reset_done(Scsi_Cmnd *SCpnt) 1005static void reset_done(struct scsi_cmnd *SCpnt)
1002{ 1006{
1003 if(SCSEM(SCpnt)) { 1007 if(SCSEM(SCpnt)) {
1004 complete(SCSEM(SCpnt)); 1008 complete(SCSEM(SCpnt));
@@ -1011,10 +1015,10 @@ static void reset_done(Scsi_Cmnd *SCpnt)
1011 * Abort a command 1015 * Abort a command
1012 * 1016 *
1013 */ 1017 */
1014static int aha152x_abort(Scsi_Cmnd *SCpnt) 1018static int aha152x_abort(struct scsi_cmnd *SCpnt)
1015{ 1019{
1016 struct Scsi_Host *shpnt = SCpnt->device->host; 1020 struct Scsi_Host *shpnt = SCpnt->device->host;
1017 Scsi_Cmnd *ptr; 1021 struct scsi_cmnd *ptr;
1018 unsigned long flags; 1022 unsigned long flags;
1019 1023
1020 DO_LOCK(flags); 1024 DO_LOCK(flags);
@@ -1052,7 +1056,7 @@ static int aha152x_abort(Scsi_Cmnd *SCpnt)
1052 * Reset a device 1056 * Reset a device
1053 * 1057 *
1054 */ 1058 */
1055static int aha152x_device_reset(Scsi_Cmnd * SCpnt) 1059static int aha152x_device_reset(struct scsi_cmnd * SCpnt)
1056{ 1060{
1057 struct Scsi_Host *shpnt = SCpnt->device->host; 1061 struct Scsi_Host *shpnt = SCpnt->device->host;
1058 DECLARE_COMPLETION(done); 1062 DECLARE_COMPLETION(done);
@@ -1110,13 +1114,14 @@ static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
1110 return ret; 1114 return ret;
1111} 1115}
1112 1116
1113static void free_hard_reset_SCs(struct Scsi_Host *shpnt, Scsi_Cmnd **SCs) 1117static void free_hard_reset_SCs(struct Scsi_Host *shpnt,
1118 struct scsi_cmnd **SCs)
1114{ 1119{
1115 Scsi_Cmnd *ptr; 1120 struct scsi_cmnd *ptr;
1116 1121
1117 ptr=*SCs; 1122 ptr=*SCs;
1118 while(ptr) { 1123 while(ptr) {
1119 Scsi_Cmnd *next; 1124 struct scsi_cmnd *next;
1120 1125
1121 if(SCDATA(ptr)) { 1126 if(SCDATA(ptr)) {
1122 next = SCNEXT(ptr); 1127 next = SCNEXT(ptr);
@@ -1171,7 +1176,7 @@ static int aha152x_bus_reset_host(struct Scsi_Host *shpnt)
1171 * Reset the bus 1176 * Reset the bus
1172 * 1177 *
1173 */ 1178 */
1174static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) 1179static int aha152x_bus_reset(struct scsi_cmnd *SCpnt)
1175{ 1180{
1176 return aha152x_bus_reset_host(SCpnt->device->host); 1181 return aha152x_bus_reset_host(SCpnt->device->host);
1177} 1182}
@@ -1436,7 +1441,7 @@ static void busfree_run(struct Scsi_Host *shpnt)
1436 1441
1437 if(!(DONE_SC->SCp.phase & not_issued)) { 1442 if(!(DONE_SC->SCp.phase & not_issued)) {
1438 struct aha152x_scdata *sc; 1443 struct aha152x_scdata *sc;
1439 Scsi_Cmnd *ptr = DONE_SC; 1444 struct scsi_cmnd *ptr = DONE_SC;
1440 DONE_SC=NULL; 1445 DONE_SC=NULL;
1441 1446
1442 sc = SCDATA(ptr); 1447 sc = SCDATA(ptr);
@@ -1451,7 +1456,7 @@ static void busfree_run(struct Scsi_Host *shpnt)
1451 } 1456 }
1452 1457
1453 if(DONE_SC && DONE_SC->scsi_done) { 1458 if(DONE_SC && DONE_SC->scsi_done) {
1454 Scsi_Cmnd *ptr = DONE_SC; 1459 struct scsi_cmnd *ptr = DONE_SC;
1455 DONE_SC=NULL; 1460 DONE_SC=NULL;
1456 1461
1457 /* turn led off, when no commands are in the driver */ 1462 /* turn led off, when no commands are in the driver */
@@ -2247,13 +2252,13 @@ static void parerr_run(struct Scsi_Host *shpnt)
2247 */ 2252 */
2248static void rsti_run(struct Scsi_Host *shpnt) 2253static void rsti_run(struct Scsi_Host *shpnt)
2249{ 2254{
2250 Scsi_Cmnd *ptr; 2255 struct scsi_cmnd *ptr;
2251 2256
2252 shost_printk(KERN_NOTICE, shpnt, "scsi reset in\n"); 2257 shost_printk(KERN_NOTICE, shpnt, "scsi reset in\n");
2253 2258
2254 ptr=DISCONNECTED_SC; 2259 ptr=DISCONNECTED_SC;
2255 while(ptr) { 2260 while(ptr) {
2256 Scsi_Cmnd *next = SCNEXT(ptr); 2261 struct scsi_cmnd *next = SCNEXT(ptr);
2257 2262
2258 if (!ptr->device->soft_reset) { 2263 if (!ptr->device->soft_reset) {
2259 remove_SC(&DISCONNECTED_SC, ptr); 2264 remove_SC(&DISCONNECTED_SC, ptr);
@@ -2438,7 +2443,7 @@ static void disp_enintr(struct Scsi_Host *shpnt)
2438/* 2443/*
2439 * Show the command data of a command 2444 * Show the command data of a command
2440 */ 2445 */
2441static void show_command(Scsi_Cmnd *ptr) 2446static void show_command(struct scsi_cmnd *ptr)
2442{ 2447{
2443 scsi_print_command(ptr); 2448 scsi_print_command(ptr);
2444 scmd_printk(KERN_DEBUG, ptr, 2449 scmd_printk(KERN_DEBUG, ptr,
@@ -2462,7 +2467,7 @@ static void show_command(Scsi_Cmnd *ptr)
2462 */ 2467 */
2463static void show_queues(struct Scsi_Host *shpnt) 2468static void show_queues(struct Scsi_Host *shpnt)
2464{ 2469{
2465 Scsi_Cmnd *ptr; 2470 struct scsi_cmnd *ptr;
2466 unsigned long flags; 2471 unsigned long flags;
2467 2472
2468 DO_LOCK(flags); 2473 DO_LOCK(flags);
@@ -2484,7 +2489,7 @@ static void show_queues(struct Scsi_Host *shpnt)
2484 disp_enintr(shpnt); 2489 disp_enintr(shpnt);
2485} 2490}
2486 2491
2487static void get_command(struct seq_file *m, Scsi_Cmnd * ptr) 2492static void get_command(struct seq_file *m, struct scsi_cmnd * ptr)
2488{ 2493{
2489 int i; 2494 int i;
2490 2495
@@ -2813,7 +2818,7 @@ static int aha152x_set_info(struct Scsi_Host *shpnt, char *buffer, int length)
2813static int aha152x_show_info(struct seq_file *m, struct Scsi_Host *shpnt) 2818static int aha152x_show_info(struct seq_file *m, struct Scsi_Host *shpnt)
2814{ 2819{
2815 int i; 2820 int i;
2816 Scsi_Cmnd *ptr; 2821 struct scsi_cmnd *ptr;
2817 unsigned long flags; 2822 unsigned long flags;
2818 2823
2819 seq_puts(m, AHA152X_REVID "\n"); 2824 seq_puts(m, AHA152X_REVID "\n");