Re: [PATCH 28/31] scsi_setup_fs_cmnd(): Call scsi_req_init() instead of open-coding it

2017-05-23 Thread Hannes Reinecke
On 05/24/2017 02:34 AM, Bart Van Assche wrote:
> The only functional change is that this patch causes scsi_setup_fs_cmnd()
> to clear scsi_request.sense_len.
> 
> Signed-off-by: Bart Van Assche 
> Reviewed-by: Christoph Hellwig 
> Cc: Hannes Reinecke 
> ---
>  drivers/scsi/scsi_lib.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)


[PATCH 28/31] scsi_setup_fs_cmnd(): Call scsi_req_init() instead of open-coding it

2017-05-23 Thread Bart Van Assche
The only functional change is that this patch causes scsi_setup_fs_cmnd()
to clear scsi_request.sense_len.

Signed-off-by: Bart Van Assche 
Reviewed-by: Christoph Hellwig 
Cc: Hannes Reinecke 
---
 drivers/scsi/scsi_lib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 612bf6c201dc..2d680d8ea80f 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1211,8 +1211,8 @@ static int scsi_setup_fs_cmnd(struct scsi_device *sdev, 
struct request *req)
return ret;
}
 
-   cmd->cmnd = scsi_req(req)->cmd = scsi_req(req)->__cmd;
-   memset(cmd->cmnd, 0, BLK_MAX_CDB);
+   scsi_req_init(&cmd->req);
+   cmd->cmnd = scsi_req(req)->cmd;
return scsi_cmd_to_driver(cmd)->init_command(cmd);
 }
 
-- 
2.12.2