[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1539977925.81977.55.camel@acm.org>
Date: Fri, 19 Oct 2018 12:38:45 -0700
From: Bart Van Assche <bvanassche@....org>
To: Nathan Chancellor <natechancellor@...il.com>,
Jens Axboe <axboe@...nel.dk>,
"James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>
Cc: Adaptec OEM Raid Solutions <aacraid@...rosemi.com>,
"Manoj N. Kumar" <manoj@...ux.vnet.ibm.com>,
"Matthew R. Ochs" <mrochs@...ux.vnet.ibm.com>,
Uma Krishnan <ukrishn@...ux.vnet.ibm.com>,
Bradley Grove <linuxdrivers@...otech.com>,
Don Brace <don.brace@...rosemi.com>,
Brian King <brking@...ibm.com>, linux-ide@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
esc.storagedev@...rosemi.com
Subject: Re: [PATCH] scsi/ata: Use unsigned int for cmd's type in ioctls in
scsi_host_template
On Fri, 2018-10-19 at 10:57 -0700, Nathan Chancellor wrote:
> 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 find into type 'int', which is used for the cmd paremeter 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 to take a negative
> value, it brings the ioctls inline with the reset of the kernel, and it
> removes ambiguity, which is never good when dealing with compilers.
Reviewed-by: Bart Van Assche <bvanassche@....org>
Powered by blists - more mailing lists