提交 0624cbb1 编写于 作者: B Bart Van Assche 提交者: Martin K. Petersen

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: NBart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: NHannes Reinecke <hare@suse.com>
Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 bed2213d
...@@ -1013,7 +1013,7 @@ static int sd_setup_read_write_cmnd(struct scsi_cmnd *SCpnt) ...@@ -1013,7 +1013,7 @@ static int sd_setup_read_write_cmnd(struct scsi_cmnd *SCpnt)
ret = scsi_init_io(SCpnt); ret = scsi_init_io(SCpnt);
if (ret != BLKPREP_OK) if (ret != BLKPREP_OK)
goto out; goto out;
SCpnt = rq->special; WARN_ON_ONCE(SCpnt != rq->special);
/* from here on until we're complete, any goto out /* from here on until we're complete, any goto out
* is used for a killable error condition */ * is used for a killable error condition */
......
...@@ -393,7 +393,7 @@ static int sr_init_command(struct scsi_cmnd *SCpnt) ...@@ -393,7 +393,7 @@ static int sr_init_command(struct scsi_cmnd *SCpnt)
ret = scsi_init_io(SCpnt); ret = scsi_init_io(SCpnt);
if (ret != BLKPREP_OK) if (ret != BLKPREP_OK)
goto out; goto out;
SCpnt = rq->special; WARN_ON_ONCE(SCpnt != rq->special);
cd = scsi_cd(rq->rq_disk); cd = scsi_cd(rq->rq_disk);
/* from here on until we're complete, any goto out /* from here on until we're complete, any goto out
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册