OSDN Git Service

scsi: sd: define variable dif as unsigned int instead of bool
authorXiang Chen <chenxiang66@hisilicon.com>
Tue, 22 Oct 2019 06:27:08 +0000 (14:27 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 25 Oct 2019 00:34:10 +0000 (20:34 -0400)
commit0cf9f4e547cebb5f5d2d046437c71ddcc8ea4a39
tree741faaddd2164a0a17f01fab377e4d5bf372026e
parentfc5b220b2dcf8b512d9bd46fd17f82257e49bf89
scsi: sd: define variable dif as unsigned int instead of bool

Variable dif in function sd_setup_read_write_cmnd() is the return value of
function scsi_host_dif_capable() which returns dif capability of disks.  If
define it as bool, even for the disks which support DIF3, the function
still return dif=1, which causes IO error. So define variable dif as
unsigned int instead of bool.

Fixes: e249e42d277e ("scsi: sd: Clean up sd_setup_read_write_cmnd()")
Link: https://lore.kernel.org/r/1571725628-132736-1-git-send-email-chenxiang66@hisilicon.com
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/sd.c