summaryrefslogtreecommitdiff
path: root/include/scsi/scsi_cmnd.h
diff options
context:
space:
mode:
authorDamien Le Moal <damien.lemoal@wdc.com>2020-05-07 11:35:26 +0900
committerMartin K. Petersen <martin.petersen@oracle.com>2020-05-07 20:45:02 -0400
commit108e36f0d8bf91839613d8053a6d1354965801b0 (patch)
tree6791e13e7771e7189956788ea3819c4650238ca3 /include/scsi/scsi_cmnd.h
parent64e14ece07004f0bf434fe7aad4a6d6411b1d9b6 (diff)
downloadlinux-next-108e36f0d8bf91839613d8053a6d1354965801b0.tar.gz
scsi: scsi_debug: Disallow zone sizes that are not powers of 2
Allowing a non-power-of-2 zone size forces the use of direct division operations of 64-bit sector values to obtain a zone number or number of zones. Doing so without using do_div() leads to compilation errors on 32-bit architectures. Devices with a zone size that is not a power of 2 do not exist today so allowing their emulation is of limited interest as the sd driver will not support them anyway. To fix this compilation error, instead of using do_div() for sector values divisions, simply disallow zone size values that are not a power of 2. [mkp: commit desc] Link: https://lore.kernel.org/r/20200507023526.221574-1-damien.lemoal@wdc.com Fixes: 98e0a689868c ("scsi: scsi_debug: Add zone_size_mb module parameter") Fixes: f0d1cf9378bd ("scsi: scsi_debug: Add ZBC zone commands") Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/scsi/scsi_cmnd.h')
0 files changed, 0 insertions, 0 deletions