Commit 91ebc1fa authored by Johannes Thumshirn's avatar Johannes Thumshirn Committed by Martin K. Petersen
Browse files

scsi: core: remove Scsi_Cmnd typedef



This will make subsequent refactoring easier to handle.

Note: this patch is nowhere checkpatch clean.

Signed-off-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: default avatarBart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent aa154ea8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1925,7 +1925,7 @@ static int tw_scsi_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_c
	if (test_bit(TW_IN_RESET, &tw_dev->flags))
		return SCSI_MLQUEUE_HOST_BUSY;

	/* Save done function into Scsi_Cmnd struct */
	/* Save done function into struct scsi_cmnd */
	SCpnt->scsi_done = done;
		 
	/* Queue the command and get a request id */
+1 −1
Original line number Diff line number Diff line
@@ -8466,7 +8466,7 @@ static int AdvExeScsiQueue(ADV_DVC_VAR *asc_dvc, adv_req_t *reqp)
}

/*
 * Execute a single 'Scsi_Cmnd'.
 * Execute a single 'struct scsi_cmnd'.
 */
static int asc_execute_scsi_cmnd(struct scsi_cmnd *scp)
{
+38 −33
Original line number Diff line number Diff line
@@ -422,16 +422,16 @@ enum aha152x_state {
 *
 */
struct aha152x_hostdata {
	Scsi_Cmnd *issue_SC;
	struct scsi_cmnd *issue_SC;
		/* pending commands to issue */

	Scsi_Cmnd *current_SC;
	struct scsi_cmnd *current_SC;
		/* current command on the bus */

	Scsi_Cmnd *disconnected_SC;
	struct scsi_cmnd *disconnected_SC;
		/* commands that disconnected */

	Scsi_Cmnd *done_SC;
	struct scsi_cmnd *done_SC;
		/* command that was completed */

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

/* diagnostics */
static void show_command(Scsi_Cmnd * ptr);
static void show_command(struct scsi_cmnd * ptr);
static void show_queues(struct Scsi_Host *shpnt);
static void disp_enintr(struct Scsi_Host *shpnt);

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

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

static inline Scsi_Cmnd *remove_first_SC(Scsi_Cmnd ** SC)
static inline struct scsi_cmnd *remove_first_SC(struct scsi_cmnd ** SC)
{
	Scsi_Cmnd *ptr;
	struct scsi_cmnd *ptr;

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

static inline Scsi_Cmnd *remove_lun_SC(Scsi_Cmnd ** SC, int target, int lun)
static inline struct scsi_cmnd *remove_lun_SC(struct scsi_cmnd ** SC,
					      int target, int lun)
{
	Scsi_Cmnd *ptr, *prev;
	struct scsi_cmnd *ptr, *prev;

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

static inline Scsi_Cmnd *remove_SC(Scsi_Cmnd **SC, Scsi_Cmnd *SCp)
static inline struct scsi_cmnd *remove_SC(struct scsi_cmnd **SC,
					  struct scsi_cmnd *SCp)
{
	Scsi_Cmnd *ptr, *prev;
	struct scsi_cmnd *ptr, *prev;

	for (ptr = *SC, prev = NULL;
	     ptr && SCp!=ptr;
@@ -912,8 +914,9 @@ static int setup_expected_interrupts(struct Scsi_Host *shpnt)
/*
 *  Queue a command and setup interrupts for a free bus.
 */
static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete,
		int phase, void (*done)(Scsi_Cmnd *))
static int aha152x_internal_queue(struct scsi_cmnd *SCpnt,
				  struct completion *complete,
				  int phase, void (*done)(struct scsi_cmnd *))
{
	struct Scsi_Host *shpnt = SCpnt->device->host;
	unsigned long flags;
@@ -987,7 +990,8 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct completion *complete,
 *  queue a command
 *
 */
static int aha152x_queue_lck(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
static int aha152x_queue_lck(struct scsi_cmnd *SCpnt,
			     void (*done)(struct scsi_cmnd *))
{
	return aha152x_internal_queue(SCpnt, NULL, 0, done);
}
@@ -998,7 +1002,7 @@ static DEF_SCSI_QCMD(aha152x_queue)
/*
 *
 */
static void reset_done(Scsi_Cmnd *SCpnt)
static void reset_done(struct scsi_cmnd *SCpnt)
{
	if(SCSEM(SCpnt)) {
		complete(SCSEM(SCpnt));
@@ -1011,10 +1015,10 @@ static void reset_done(Scsi_Cmnd *SCpnt)
 *  Abort a command
 *
 */
static int aha152x_abort(Scsi_Cmnd *SCpnt)
static int aha152x_abort(struct scsi_cmnd *SCpnt)
{
	struct Scsi_Host *shpnt = SCpnt->device->host;
	Scsi_Cmnd *ptr;
	struct scsi_cmnd *ptr;
	unsigned long flags;

	DO_LOCK(flags);
@@ -1052,7 +1056,7 @@ static int aha152x_abort(Scsi_Cmnd *SCpnt)
 * Reset a device
 *
 */
static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
static int aha152x_device_reset(struct scsi_cmnd * SCpnt)
{
	struct Scsi_Host *shpnt = SCpnt->device->host;
	DECLARE_COMPLETION(done);
@@ -1110,13 +1114,14 @@ static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
	return ret;
}

static void free_hard_reset_SCs(struct Scsi_Host *shpnt, Scsi_Cmnd **SCs)
static void free_hard_reset_SCs(struct Scsi_Host *shpnt,
				struct scsi_cmnd **SCs)
{
	Scsi_Cmnd *ptr;
	struct scsi_cmnd *ptr;

	ptr=*SCs;
	while(ptr) {
		Scsi_Cmnd *next;
		struct scsi_cmnd *next;

		if(SCDATA(ptr)) {
			next = SCNEXT(ptr);
@@ -1171,7 +1176,7 @@ static int aha152x_bus_reset_host(struct Scsi_Host *shpnt)
 * Reset the bus
 *
 */
static int aha152x_bus_reset(Scsi_Cmnd *SCpnt)
static int aha152x_bus_reset(struct scsi_cmnd *SCpnt)
{
	return aha152x_bus_reset_host(SCpnt->device->host);
}
@@ -1436,7 +1441,7 @@ static void busfree_run(struct Scsi_Host *shpnt)

			if(!(DONE_SC->SCp.phase & not_issued)) {
				struct aha152x_scdata *sc;
				Scsi_Cmnd *ptr = DONE_SC;
				struct scsi_cmnd *ptr = DONE_SC;
				DONE_SC=NULL;

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

		if(DONE_SC && DONE_SC->scsi_done) {
			Scsi_Cmnd *ptr = DONE_SC;
			struct scsi_cmnd *ptr = DONE_SC;
			DONE_SC=NULL;

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

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

	ptr=DISCONNECTED_SC;
	while(ptr) {
		Scsi_Cmnd *next = SCNEXT(ptr);
		struct scsi_cmnd *next = SCNEXT(ptr);

		if (!ptr->device->soft_reset) {
			remove_SC(&DISCONNECTED_SC, ptr);
@@ -2438,7 +2443,7 @@ static void disp_enintr(struct Scsi_Host *shpnt)
/*
 * Show the command data of a command
 */
static void show_command(Scsi_Cmnd *ptr)
static void show_command(struct scsi_cmnd *ptr)
{
	scsi_print_command(ptr);
	scmd_printk(KERN_DEBUG, ptr,
@@ -2462,7 +2467,7 @@ static void show_command(Scsi_Cmnd *ptr)
 */
static void show_queues(struct Scsi_Host *shpnt)
{
	Scsi_Cmnd *ptr;
	struct scsi_cmnd *ptr;
	unsigned long flags;

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

static void get_command(struct seq_file *m, Scsi_Cmnd * ptr)
static void get_command(struct seq_file *m, struct scsi_cmnd * ptr)
{
	int i;

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

	seq_puts(m, AHA152X_REVID "\n");
+5 −4
Original line number Diff line number Diff line
@@ -207,11 +207,11 @@ static int aha1740_test_port(unsigned int base)
static irqreturn_t aha1740_intr_handle(int irq, void *dev_id)
{
	struct Scsi_Host *host = (struct Scsi_Host *) dev_id;
        void (*my_done)(Scsi_Cmnd *);
        void (*my_done)(struct scsi_cmnd *);
	int errstatus, adapstat;
	int number_serviced;
	struct ecb *ecbptr;
	Scsi_Cmnd *SCtmp;
	struct scsi_cmnd *SCtmp;
	unsigned int base;
	unsigned long flags;
	int handled = 0;
@@ -311,7 +311,8 @@ static irqreturn_t aha1740_intr_handle(int irq, void *dev_id)
	return IRQ_RETVAL(handled);
}

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

static int aha1740_eh_abort_handler (Scsi_Cmnd *dummy)
static int aha1740_eh_abort_handler (struct scsi_cmnd *dummy)
{
/*
 * From Alan Cox :
+2 −2
Original line number Diff line number Diff line
@@ -135,8 +135,8 @@ struct ecb { /* Enhanced Control Block 6.1 */
/* Hardware defined portion ends here, rest is driver defined */
	u8 sense[MAX_SENSE];	/* Sense area */
	u8 status[MAX_STATUS];	/* Status area */
	Scsi_Cmnd *SCpnt;	/* Link to the SCSI Command Block */
	void (*done) (Scsi_Cmnd *);	/* Completion Function */
	struct scsi_cmnd *SCpnt;	/* Link to the SCSI Command Block */
	void (*done) (struct scsi_cmnd *);	/* Completion Function */
};

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