From: Jens Axboe <axboe@kernel.dk>
To: Arnd Bergmann <arnd@arndb.de>, Jiri Kosina <jikos@kernel.org>
Cc: Robert Elliott <elliott@hpe.com>, Keith Busch <kbusch@kernel.org>,
Hannes Reinecke <hare@suse.de>, Omar Sandoval <osandov@fb.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Andy Whitcroft <apw@canonical.com>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [RESEND] floppy: fix harmless clang build warning
Date: Thu, 20 Jun 2019 01:36:43 -0600 [thread overview]
Message-ID: <649b433f-9a6b-a8a8-65ea-aa15a6296246@kernel.dk> (raw)
In-Reply-To: <20190619131959.2055400-1-arnd@arndb.de>
On 6/19/19 7:19 AM, Arnd Bergmann wrote:
> clang warns about unusual code in floppy.c that looks like it
> was intended to be a bit mask operation, checking for a specific
> bit in the UDP->cmos variable (FLOPPY1_TYPE expands to '4' on
> ARM):
>
> drivers/block/floppy.c:3902:17: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand]
> if (!UDP->cmos && FLOPPY1_TYPE)
> ^ ~~~~~~~~~~~~
> drivers/block/floppy.c:3902:17: note: use '&' for a bitwise operation
> if (!UDP->cmos && FLOPPY1_TYPE)
>
> The check here is redundant anyway, if FLOPPY1_TYPE is zero, then
> assigning it to a zero UDP->cmos field does not change anything,
> so removing the extra check here has no effect other than shutting
> up the warning.
>
> On x86, this will no longer read a hardware register, as the
> FLOPPY1_TYPE macro is not expanded if UDP->cmos is already
> zero, but the result is the same.
Applied, thanks.
--
Jens Axboe
prev parent reply other threads:[~2019-06-20 7:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-19 13:19 Arnd Bergmann
2019-06-20 7:36 ` Jens Axboe [this message]
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=649b433f-9a6b-a8a8-65ea-aa15a6296246@kernel.dk \
--to=axboe@kernel.dk \
--cc=apw@canonical.com \
--cc=arnd@arndb.de \
--cc=elliott@hpe.com \
--cc=hare@suse.de \
--cc=jikos@kernel.org \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=osandov@fb.com \
--cc=sakari.ailus@linux.intel.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
all inboxes | Powered by JetHome®