linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Gonzalez <marc.w.gonzalez@free.fr>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	SCSI <linux-scsi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] scsi/ata: Use unsigned int for cmd's type in ioctls in scsi_host_template
Date: Thu, 7 Feb 2019 11:52:58 +0100	[thread overview]
Message-ID: <97d4ab84-f64b-9276-b7a9-3b3be5f5d527@free.fr> (raw)
In-Reply-To: <20190126075256.29608-1-natechancellor@gmail.com>

On 26/01/2019 08:52, 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
              ^^^^                                            ^^^^^^^^^

"which don't fit"
"the cmd parameter"

Regards.

> 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.
> 
> 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>
> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
> ---
> 
> v3 -> v4:
> 
> * Repost with Bart's suggested change and his reviewed by (mainly as an
>   excuse to repost with the below comment).
> 
> v2 -> v3:
> 
> * Fix another -Wswitch warning from drivers/scsi/cxlflash/main.c, coming
>   from decode_hioctl (uncovered via a powernv_defconfig build).
> 
> v1 -> v2:
> 
> * Fix build breakage in cxlflash driver from forgetting to update
>   prototype (thanks to 0day for catching it).
> 
> I apologize for resending this so soon after v3 but it has been three
> months since I sent this patch and I have yet to receive a single
> comment from ANY of the maintainers that './scripts/get_maintainer.pl'
> spits out for this patch so it feels like I am sending it into the void.
> 
> I understand you all are busy people and such and maybe I am being
> impatient but these warnings are rather spammy and we're trying to get
> that category cleaned up as quick as possible so that new warnings are
> easier to spot. I'd appreciate any and all reviews/acks/testing that I
> can get on this patch (especially since it is so simple) so it can be
> accepted and merged into mainline.

  parent reply	other threads:[~2019-02-07 10:53 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
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 [this message]
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=97d4ab84-f64b-9276-b7a9-3b3be5f5d527@free.fr \
    --to=marc.w.gonzalez@free.fr \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=natechancellor@gmail.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).