[PATCH 4/4] gdth: stop abusing ->request pointer for completion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Do not overload the request point for completion but rather use
a dedicated field in the cmndinfo structure.

Signed-off-by: Hannes Reinecke <hare@xxxxxxx>
---
 drivers/scsi/gdth.c | 5 ++---
 drivers/scsi/gdth.h | 1 +
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
index 6b509ba40017..aeebf10a32a3 100644
--- a/drivers/scsi/gdth.c
+++ b/drivers/scsi/gdth.c
@@ -327,7 +327,7 @@ static void gdth_scsi_done(struct scsi_cmnd *scp)
 	scp->host_scribble = NULL;
 
 	if (internal_command)
-		complete((struct completion *)scp->request);
+		complete(cmndinfo->complete);
 	else
 		scp->scsi_done(scp);
 }
@@ -353,13 +353,12 @@ int gdth_execute(gdth_ha_str *ha, gdth_cmd_str *gdtcmd, char *cmnd,
 	scp->device = ha->sdev;
 	memset(&cmndinfo, 0, sizeof(cmndinfo));
 
-	/* use request field to save the ptr. to completion struct. */
-	scp->request = (struct request *)&wait;
 	scp->cmd_len = 12;
 	scp->cmnd = cmnd;
 	cmndinfo.priority = IOCTL_PRI;
 	cmndinfo.internal_cmd_str = gdtcmd;
 	cmndinfo.internal_command = 1;
+	cmndinfo.complete = &wait;
 
 	TRACE(("__gdth_execute() cmd 0x%x\n", scp->cmnd[0]));
 	__gdth_queuecommand(ha, scp, &cmndinfo);
diff --git a/drivers/scsi/gdth.h b/drivers/scsi/gdth.h
index 01ddfd0cfda6..dca52583eefc 100644
--- a/drivers/scsi/gdth.h
+++ b/drivers/scsi/gdth.h
@@ -877,6 +877,7 @@ typedef struct {
 		u8 priority;
 		int timeout_count;		/* # of timeout calls */
 		volatile int wait_for_completion;
+		struct completion *complete;
 		u16 status;
 		u32 info;
 		enum dma_data_direction dma_dir;
-- 
2.16.4




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux