]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: sd: Clean up sd_setup_read_write_cmnd()
authorMartin K. Petersen <martin.petersen@oracle.com>
Wed, 16 Jan 2019 00:50:01 +0000 (16:50 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 23 Jan 2019 02:18:27 +0000 (21:18 -0500)
commitc9d1a4825ac913f9fc28576653d218ca5a589619
tree7a32748274369927913a3693c11da8f77a01cfc6
parent9cfb16cc8f20599dac9c6912aee79f18d1d0f9e4
scsi: sd: Clean up sd_setup_read_write_cmnd()

Rework sd_setup_read_write_cmnd() so it becomes more readable. Put all the
sanity checking at the head of the function and sanitize the logged error
messages. Move the legacy SCSI logging calls to the end of the functions
and reduce conditional nesting.

Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
[ bvanassche: ported this patch from kernel v4.11 to kernel v5.0 ]
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/sd.c