lkml.org 
[lkml]   [2019]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] floppy: fix harmless clang build warning
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.

\
 
 \ /
  Last update: 2019-03-13 23:13    [W:0.063 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site