diff mbox series

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

Message ID 20200616121821.99113-5-hare@suse.de (mailing list archive)
State Superseded
Headers show
Series gdth: bring driver into this century | expand

Commit Message

Hannes Reinecke June 16, 2020, 12:18 p.m. UTC
Do not overload the request point for completion but rather use
a dedicated field in the cmndinfo structure.

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

Comments

Daniel Wagner June 18, 2020, 8:09 a.m. UTC | #1
On Tue, Jun 16, 2020 at 02:18:21PM +0200, Hannes Reinecke wrote:
> Do not overload the request point for completion but rather use
> a dedicated field in the cmndinfo structure.
> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>

Reviewed-by: Daniel Wagner <dwagner@suse.de>
diff mbox series

Patch

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;