From: Bart Van Assche <bvanassche@acm.org>
To: Nathan Chancellor <natechancellor@gmail.com>,
Jens Axboe <axboe@kernel.dk>,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Adaptec OEM Raid Solutions <aacraid@microsemi.com>,
"Manoj N. Kumar" <manoj@linux.vnet.ibm.com>,
"Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>,
Uma Krishnan <ukrishn@linux.vnet.ibm.com>,
Bradley Grove <linuxdrivers@attotech.com>,
Don Brace <don.brace@microsemi.com>,
Brian King <brking@us.ibm.com>,
linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-scsi@vger.kernel.org, esc.storagedev@microsemi.com
Subject: Re: [PATCH] scsi/ata: Use unsigned int for cmd's type in ioctls in scsi_host_template
Date: Fri, 19 Oct 2018 12:38:45 -0700 [thread overview]
Message-ID: <1539977925.81977.55.camel@acm.org> (raw)
In-Reply-To: <20181019175714.444-1-natechancellor@gmail.com>
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@acm.org>
next prev parent reply other threads:[~2018-10-19 19:38 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-19 17:57 [PATCH] scsi/ata: Use unsigned int for cmd's type in ioctls in scsi_host_template Nathan Chancellor
2018-10-19 19:38 ` Bart Van Assche [this message]
2018-10-20 4:52 ` kbuild test robot
2018-10-20 5:01 ` [PATCH v2] " Nathan Chancellor
2018-12-17 17:31 ` Nathan Chancellor
2019-01-14 4:42 ` [PATCH v3] " Nathan Chancellor
2019-01-14 4:54 ` Bart Van Assche
2019-01-14 4:57 ` Nathan Chancellor
2019-01-26 7:52 ` [PATCH v4] " Nathan Chancellor
2019-01-26 9:19 ` Nick Desaulniers
2019-01-28 16:16 ` Don.Brace
2019-01-28 16:17 ` Nathan Chancellor
2019-02-05 18:42 ` Grove, Bradley
2019-02-07 10:52 ` Marc Gonzalez
2019-02-07 16:07 ` [PATCH v5] " Nathan Chancellor
2019-02-07 19:17 ` Nick Desaulniers
2019-02-08 8:05 ` Christoph Hellwig
2019-02-08 16:00 ` Nathan Chancellor
2019-02-08 22:33 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1539977925.81977.55.camel@acm.org \
--to=bvanassche@acm.org \
--cc=aacraid@microsemi.com \
--cc=axboe@kernel.dk \
--cc=brking@us.ibm.com \
--cc=don.brace@microsemi.com \
--cc=esc.storagedev@microsemi.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxdrivers@attotech.com \
--cc=manoj@linux.vnet.ibm.com \
--cc=martin.petersen@oracle.com \
--cc=mrochs@linux.vnet.ibm.com \
--cc=natechancellor@gmail.com \
--cc=ukrishn@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).