On 1/11/19 1:08 AM, Bart Van Assche wrote:
From: "Martin K. Petersen" <martin.petersen@xxxxxxxxxx> 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. Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx> [ bvanassche: ported this patch from kernel v4.11 to kernel v5.0 ] Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> --- drivers/scsi/sd.c | 80 +++++++++++++++++------------------------------ 1 file changed, 28 insertions(+), 52 deletions(-)
Reviewed-by: Hannes Reinecke <hare@xxxxxxxx> Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@xxxxxxx +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)