From: Keith Busch <kbusch@kernel.org>
To: "Elliott, Robert (Persistent Memory)" <elliott@hpe.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Jiri Kosina <jikos@kernel.org>,
Jens Axboe <axboe@kernel.dk>, Omar Sandoval <osandov@fb.com>,
Hannes Reinecke <hare@suse.de>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] floppy: fix harmless clang build warning
Date: Wed, 13 Mar 2019 16:12:58 -0600 [thread overview]
Message-ID: <20190313221257.GA15153@localhost.localdomain> (raw)
In-Reply-To: <AT5PR8401MB116964D0C90783A164834C2CAB4A0@AT5PR8401MB1169.NAMPRD84.PROD.OUTLOOK.COM>
On Wed, Mar 13, 2019 at 10:01:43PM +0000, Elliott, Robert (Persistent Memory) wrote:
> > @@ -3899,7 +3899,7 @@ static void __init config_types(void)
> > if (!UDP->cmos)
> > UDP->cmos = FLOPPY0_TYPE;
> > drive = 1;
> > - if (!UDP->cmos && FLOPPY1_TYPE)
> > + if (!UDP->cmos)
> > UDP->cmos = FLOPPY1_TYPE;
> >
> > /* FIXME: additional physical CMOS drive detection should go here */
> > --
> > 2.20.0
>
> On x86 it expands to a hardware read, so this would change the control flow.
>
> #define FLOPPY1_TYPE \
> ({ \
> unsigned long flags; \
> unsigned char val; \
> spin_lock_irqsave(&rtc_lock, flags); \
> val = CMOS_READ(0x10) & 15; \
> spin_unlock_irqrestore(&rtc_lock, flags); \
> val; \
> })
The end result is still the same, though. It just doesn't read the
hardware twice when FLOPPY1_TYPE is non-zero.
prev parent reply other threads:[~2019-03-13 22:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-13 21:11 [PATCH] floppy: fix harmless clang build warning Arnd Bergmann
2019-03-13 22:01 ` Elliott, Robert (Persistent Memory)
2019-03-13 22:12 ` Keith Busch [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=20190313221257.GA15153@localhost.localdomain \
--to=kbusch@kernel.org \
--cc=arnd@arndb.de \
--cc=axboe@kernel.dk \
--cc=elliott@hpe.com \
--cc=hare@suse.de \
--cc=jikos@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=osandov@fb.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