Re: [PATCH] floppy: fix harmless clang build warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux