From 0624cbb1e2e64ae4d7d55dc81fc39a0af87a2bd7 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 25 Aug 2017 13:46:33 -0700 Subject: scsi: sd: sr: Convert two assignments into warning statements Before scsi_prep_fn() calls the ULP .init_command() callback function it stores the SCSI command pointer in request.special. This means that the SCpnt = rq->special assignments in the sd and sr drivers assign a pointer to itself. Hence convert these two assignment statements into warning statements. Signed-off-by: Bart Van Assche Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen --- drivers/scsi/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/scsi/sd.c') diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index bea36adeee17..a88639fbedb3 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -1013,7 +1013,7 @@ static int sd_setup_read_write_cmnd(struct scsi_cmnd *SCpnt) ret = scsi_init_io(SCpnt); if (ret != BLKPREP_OK) goto out; - SCpnt = rq->special; + WARN_ON_ONCE(SCpnt != rq->special); /* from here on until we're complete, any goto out * is used for a killable error condition */ -- cgit v1.2.3-59-g8ed1b