Skip to content

Commit 91ebc1f

Browse files
Johannes Thumshirnmartinkpetersen
authored andcommitted
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>
1 parent aa154ea commit 91ebc1f

File tree

16 files changed

+114
-109
lines changed

16 files changed

+114
-109
lines changed

drivers/scsi/3w-xxxx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1925,7 +1925,7 @@ static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_c
19251925
if (test_bit(TW_IN_RESET, &tw_dev->flags))
19261926
return SCSI_MLQUEUE_HOST_BUSY;
19271927

1928-
/* Save done function into Scsi_Cmnd struct */
1928+
/* Save done function into struct scsi_cmnd */
19291929
SCpnt->scsi_done = done;
19301930

19311931
/* Queue the command and get a request id */

drivers/scsi/advansys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8466,7 +8466,7 @@ static int AdvExeScsiQueue(ADV_DVC_VAR *asc_dvc, adv_req_t *reqp)
84668466
}
84678467

84688468
/*
8469-
* Execute a single 'Scsi_Cmnd'.
8469+
* Execute a single 'struct scsi_cmnd'.
84708470
*/
84718471
static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)
84728472
{

drivers/scsi/aha152x.c

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -422,16 +422,16 @@ enum aha152x_state {
422422
*
423423
*/
424424
struct aha152x_hostdata {
425-
Scsi_Cmnd *issue_SC;
425+
struct scsi_cmnd *issue_SC;
426426
/* pending commands to issue */
427427

428-
Scsi_Cmnd *current_SC;
428+
struct scsi_cmnd *current_SC;
429429
/* current command on the bus */
430430

431-
Scsi_Cmnd *disconnected_SC;
431+
struct scsi_cmnd *disconnected_SC;
432432
/* commands that disconnected */
433433

434-
Scsi_Cmnd *done_SC;
434+
struct scsi_cmnd *done_SC;
435435
/* command that was completed */
436436

437437
spinlock_t lock;
@@ -510,7 +510,7 @@ struct aha152x_hostdata {
510510
*
511511
*/
512512
struct aha152x_scdata {
513-
Scsi_Cmnd *next; /* next sc in queue */
513+
struct scsi_cmnd *next; /* next sc in queue */
514514
struct completion *done;/* semaphore to block on */
515515
struct scsi_eh_save ses;
516516
};
@@ -633,7 +633,7 @@ static void aha152x_error(struct Scsi_Host *shpnt, char *msg);
633633
static void done(struct Scsi_Host *shpnt, int error);
634634

635635
/* diagnostics */
636-
static void show_command(Scsi_Cmnd * ptr);
636+
static void show_command(struct scsi_cmnd * ptr);
637637
static void show_queues(struct Scsi_Host *shpnt);
638638
static void disp_enintr(struct Scsi_Host *shpnt);
639639

@@ -642,9 +642,9 @@ static void disp_enintr(struct Scsi_Host *shpnt);
642642
* queue services:
643643
*
644644
*/
645-
static inline void append_SC(Scsi_Cmnd **SC, Scsi_Cmnd *new_SC)
645+
static inline void append_SC(struct scsi_cmnd **SC, struct scsi_cmnd *new_SC)
646646
{
647-
Scsi_Cmnd *end;
647+
struct scsi_cmnd *end;
648648

649649
SCNEXT(new_SC) = NULL;
650650
if (!*SC)
@@ -656,9 +656,9 @@ static inline void append_SC(Scsi_Cmnd **SC, Scsi_Cmnd *new_SC)
656656
}
657657
}
658658

659-
static inline Scsi_Cmnd *remove_first_SC(Scsi_Cmnd ** SC)
659+
static inline struct scsi_cmnd *remove_first_SC(struct scsi_cmnd ** SC)
660660
{
661-
Scsi_Cmnd *ptr;
661+
struct scsi_cmnd *ptr;
662662

663663
ptr = *SC;
664664
if (ptr) {
@@ -668,9 +668,10 @@ static inline Scsi_Cmnd *remove_first_SC(Scsi_Cmnd ** SC)
668668
return ptr;
669669
}
670670

671-
static inline Scsi_Cmnd *remove_lun_SC(Scsi_Cmnd ** SC, int target, int lun)
671+
static inline struct scsi_cmnd *remove_lun_SC(struct scsi_cmnd ** SC,
672+
int target, int lun)
672673
{
673-
Scsi_Cmnd *ptr, *prev;
674+
struct scsi_cmnd *ptr, *prev;
674675

675676
for (ptr = *SC, prev = NULL;
676677
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)
689690
return ptr;
690691
}
691692

692-
static inline Scsi_Cmnd *remove_SC(Scsi_Cmnd **SC, Scsi_Cmnd *SCp)
693+
static inline struct scsi_cmnd *remove_SC(struct scsi_cmnd **SC,
694+
struct scsi_cmnd *SCp)
693695
{
694-
Scsi_Cmnd *ptr, *prev;
696+
struct scsi_cmnd *ptr, *prev;
695697

696698
for (ptr = *SC, prev = NULL;
697699
ptr && SCp!=ptr;
@@ -912,8 +914,9 @@ static int setup_expected_interrupts(struct Scsi_Host *shpnt)
912914
/*
913915
* Queue a command and setup interrupts for a free bus.
914916
*/
915-
static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete,
916-
int phase, void (*done)(Scsi_Cmnd *))
917+
static int aha152x_internal_queue(struct scsi_cmnd *SCpnt,
918+
struct completion *complete,
919+
int phase, void (*done)(struct scsi_cmnd *))
917920
{
918921
struct Scsi_Host *shpnt = SCpnt->device->host;
919922
unsigned long flags;
@@ -987,7 +990,8 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete,
987990
* queue a command
988991
*
989992
*/
990-
static int aha152x_queue_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
993+
static int aha152x_queue_lck(struct scsi_cmnd *SCpnt,
994+
void (*done)(struct scsi_cmnd *))
991995
{
992996
return aha152x_internal_queue(SCpnt, NULL, 0, done);
993997
}
@@ -998,7 +1002,7 @@ static DEF_SCSI_QCMD(aha152x_queue)
9981002
/*
9991003
*
10001004
*/
1001-
static void reset_done(Scsi_Cmnd *SCpnt)
1005+
static void reset_done(struct scsi_cmnd *SCpnt)
10021006
{
10031007
if(SCSEM(SCpnt)) {
10041008
complete(SCSEM(SCpnt));
@@ -1011,10 +1015,10 @@ static void reset_done(Scsi_Cmnd *SCpnt)
10111015
* Abort a command
10121016
*
10131017
*/
1014-
static int aha152x_abort(Scsi_Cmnd *SCpnt)
1018+
static int aha152x_abort(struct scsi_cmnd *SCpnt)
10151019
{
10161020
struct Scsi_Host *shpnt = SCpnt->device->host;
1017-
Scsi_Cmnd *ptr;
1021+
struct scsi_cmnd *ptr;
10181022
unsigned long flags;
10191023

10201024
DO_LOCK(flags);
@@ -1052,7 +1056,7 @@ static int aha152x_abort(Scsi_Cmnd *SCpnt)
10521056
* Reset a device
10531057
*
10541058
*/
1055-
static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
1059+
static int aha152x_device_reset(struct scsi_cmnd * SCpnt)
10561060
{
10571061
struct Scsi_Host *shpnt = SCpnt->device->host;
10581062
DECLARE_COMPLETION(done);
@@ -1110,13 +1114,14 @@ static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
11101114
return ret;
11111115
}
11121116

1113-
static void free_hard_reset_SCs(struct Scsi_Host *shpnt, Scsi_Cmnd **SCs)
1117+
static void free_hard_reset_SCs(struct Scsi_Host *shpnt,
1118+
struct scsi_cmnd **SCs)
11141119
{
1115-
Scsi_Cmnd *ptr;
1120+
struct scsi_cmnd *ptr;
11161121

11171122
ptr=*SCs;
11181123
while(ptr) {
1119-
Scsi_Cmnd *next;
1124+
struct scsi_cmnd *next;
11201125

11211126
if(SCDATA(ptr)) {
11221127
next = SCNEXT(ptr);
@@ -1171,7 +1176,7 @@ static int aha152x_bus_reset_host(struct Scsi_Host *shpnt)
11711176
* Reset the bus
11721177
*
11731178
*/
1174-
static int aha152x_bus_reset(Scsi_Cmnd *SCpnt)
1179+
static int aha152x_bus_reset(struct scsi_cmnd *SCpnt)
11751180
{
11761181
return aha152x_bus_reset_host(SCpnt->device->host);
11771182
}
@@ -1436,7 +1441,7 @@ static void busfree_run(struct Scsi_Host *shpnt)
14361441

14371442
if(!(DONE_SC->SCp.phase & not_issued)) {
14381443
struct aha152x_scdata *sc;
1439-
Scsi_Cmnd *ptr = DONE_SC;
1444+
struct scsi_cmnd *ptr = DONE_SC;
14401445
DONE_SC=NULL;
14411446

14421447
sc = SCDATA(ptr);
@@ -1451,7 +1456,7 @@ static void busfree_run(struct Scsi_Host *shpnt)
14511456
}
14521457

14531458
if(DONE_SC && DONE_SC->scsi_done) {
1454-
Scsi_Cmnd *ptr = DONE_SC;
1459+
struct scsi_cmnd *ptr = DONE_SC;
14551460
DONE_SC=NULL;
14561461

14571462
/* turn led off, when no commands are in the driver */
@@ -2247,13 +2252,13 @@ static void parerr_run(struct Scsi_Host *shpnt)
22472252
*/
22482253
static void rsti_run(struct Scsi_Host *shpnt)
22492254
{
2250-
Scsi_Cmnd *ptr;
2255+
struct scsi_cmnd *ptr;
22512256

22522257
shost_printk(KERN_NOTICE, shpnt, "scsi reset in\n");
22532258

22542259
ptr=DISCONNECTED_SC;
22552260
while(ptr) {
2256-
Scsi_Cmnd *next = SCNEXT(ptr);
2261+
struct scsi_cmnd *next = SCNEXT(ptr);
22572262

22582263
if (!ptr->device->soft_reset) {
22592264
remove_SC(&DISCONNECTED_SC, ptr);
@@ -2438,7 +2443,7 @@ static void disp_enintr(struct Scsi_Host *shpnt)
24382443
/*
24392444
* Show the command data of a command
24402445
*/
2441-
static void show_command(Scsi_Cmnd *ptr)
2446+
static void show_command(struct scsi_cmnd *ptr)
24422447
{
24432448
scsi_print_command(ptr);
24442449
scmd_printk(KERN_DEBUG, ptr,
@@ -2462,7 +2467,7 @@ static void show_command(Scsi_Cmnd *ptr)
24622467
*/
24632468
static void show_queues(struct Scsi_Host *shpnt)
24642469
{
2465-
Scsi_Cmnd *ptr;
2470+
struct scsi_cmnd *ptr;
24662471
unsigned long flags;
24672472

24682473
DO_LOCK(flags);
@@ -2484,7 +2489,7 @@ static void show_queues(struct Scsi_Host *shpnt)
24842489
disp_enintr(shpnt);
24852490
}
24862491

2487-
static void get_command(struct seq_file *m, Scsi_Cmnd * ptr)
2492+
static void get_command(struct seq_file *m, struct scsi_cmnd * ptr)
24882493
{
24892494
int i;
24902495

@@ -2813,7 +2818,7 @@ static int aha152x_set_info(struct Scsi_Host *shpnt, char *buffer, int length)
28132818
static int aha152x_show_info(struct seq_file *m, struct Scsi_Host *shpnt)
28142819
{
28152820
int i;
2816-
Scsi_Cmnd *ptr;
2821+
struct scsi_cmnd *ptr;
28172822
unsigned long flags;
28182823

28192824
seq_puts(m, AHA152X_REVID "\n");

drivers/scsi/aha1740.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,11 @@ static int aha1740_test_port(unsigned int base)
207207
static irqreturn_t aha1740_intr_handle(int irq, void *dev_id)
208208
{
209209
struct Scsi_Host *host = (struct Scsi_Host *) dev_id;
210-
void (*my_done)(Scsi_Cmnd *);
210+
void (*my_done)(struct scsi_cmnd *);
211211
int errstatus, adapstat;
212212
int number_serviced;
213213
struct ecb *ecbptr;
214-
Scsi_Cmnd *SCtmp;
214+
struct scsi_cmnd *SCtmp;
215215
unsigned int base;
216216
unsigned long flags;
217217
int handled = 0;
@@ -311,7 +311,8 @@ static irqreturn_t aha1740_intr_handle(int irq, void *dev_id)
311311
return IRQ_RETVAL(handled);
312312
}
313313

314-
static int aha1740_queuecommand_lck(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *))
314+
static int aha1740_queuecommand_lck(struct scsi_cmnd * SCpnt,
315+
void (*done)(struct scsi_cmnd *))
315316
{
316317
unchar direction;
317318
unchar *cmd = (unchar *) SCpnt->cmnd;
@@ -520,7 +521,7 @@ static int aha1740_biosparam(struct scsi_device *sdev,
520521
return 0;
521522
}
522523

523-
static int aha1740_eh_abort_handler (Scsi_Cmnd *dummy)
524+
static int aha1740_eh_abort_handler (struct scsi_cmnd *dummy)
524525
{
525526
/*
526527
* From Alan Cox :

drivers/scsi/aha1740.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ struct ecb { /* Enhanced Control Block 6.1 */
135135
/* Hardware defined portion ends here, rest is driver defined */
136136
u8 sense[MAX_SENSE]; /* Sense area */
137137
u8 status[MAX_STATUS]; /* Status area */
138-
Scsi_Cmnd *SCpnt; /* Link to the SCSI Command Block */
139-
void (*done) (Scsi_Cmnd *); /* Completion Function */
138+
struct scsi_cmnd *SCpnt; /* Link to the SCSI Command Block */
139+
void (*done) (struct scsi_cmnd *); /* Completion Function */
140140
};
141141

142142
#define AHA1740CMD_NOP 0x00 /* No OP */

0 commit comments

Comments
 (0)