linux_dsm_epyc7002/drivers/scsi/cxlflash
Nathan Chancellor 6f4e626fb0 scsi: ata: Use unsigned int for cmd's type in ioctls in scsi_host_template
Clang warns several times in the scsi subsystem (trimmed for brevity):

drivers/scsi/hpsa.c:6209:7: warning: overflow converting case value to
switch condition type (2147762695 to 18446744071562347015) [-Wswitch]
        case CCISS_GETBUSTYPES:
             ^
drivers/scsi/hpsa.c:6208:7: warning: overflow converting case value to
switch condition type (2147762694 to 18446744071562347014) [-Wswitch]
        case CCISS_GETHEARTBEAT:
             ^

The root cause is that the _IOC macro can generate really large numbers,
which don't fit into type 'int', which is used for the cmd parameter in
the ioctls in scsi_host_template. My research into how GCC and Clang are
handling this at a low level didn't prove fruitful. However, looking at
the rest of the kernel tree, all ioctls use an 'unsigned int' for the
cmd parameter, which will fit all of the _IOC values in the scsi/ata
subsystems.

Make that change because none of the ioctls expect a negative value for
any command, it brings the ioctls inline with the reset of the kernel,
and it removes ambiguity, which is never good when dealing with compilers.

Link: https://github.com/ClangBuiltLinux/linux/issues/85
Link: https://github.com/ClangBuiltLinux/linux/issues/154
Link: https://github.com/ClangBuiltLinux/linux/issues/157
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Bradley Grove <bgrove@attotech.com>
Acked-by: Don Brace <don.brace@microsemi.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-02-08 17:33:00 -05:00
..
backend.h scsi: cxlflash: Add include guards to backend.h 2018-05-18 11:22:10 -04:00
common.h scsi: ata: Use unsigned int for cmd's type in ioctls in scsi_host_template 2019-02-08 17:33:00 -05:00
cxl_hw.c scsi: cxlflash: Introduce object handle fop 2018-04-18 19:32:50 -04:00
Kconfig scsi: cxlflash: Isolate external module dependencies 2018-05-18 11:22:10 -04:00
lunmgt.c scsi: cxlflash: Isolate external module dependencies 2018-05-18 11:22:10 -04:00
main.c scsi: ata: Use unsigned int for cmd's type in ioctls in scsi_host_template 2019-02-08 17:33:00 -05:00
main.h scsi: cxlflash: fix assignment of the backend operations 2018-07-10 22:29:54 -04:00
Makefile scsi: cxlflash: Isolate external module dependencies 2018-05-18 11:22:10 -04:00
ocxl_hw.c SCSI misc on 20180815 2018-08-15 22:06:26 -07:00
ocxl_hw.h scsi: cxlflash: Register for translation errors 2018-04-18 19:32:50 -04:00
sislite.h scsi: cxlflash: Update synchronous interrupt status bits 2018-04-18 19:32:50 -04:00
superpipe.c scsi: ata: Use unsigned int for cmd's type in ioctls in scsi_host_template 2019-02-08 17:33:00 -05:00
superpipe.h scsi: cxlflash: Remove embedded CXL work structures 2018-01-10 23:24:57 -05:00
vlun.c scsi: cxlflash: Drop unused sense buffers 2018-08-02 15:19:46 -06:00
vlun.h scsi: cxlflash: Fix warnings/errors 2017-04-13 22:55:41 -04:00