Re: PATCH: io.h remove detrimental do {...} whiles, add sequence points, add const modifiers

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

 



> > >  #define set_io_port_base(base)	\
> > > -	do { * (unsigned long *) &mips_io_port_base = (base); } while (0)
> > > +	*(unsigned long *)&mips_io_port_base = (base);
>
> If Bradley loses the extra semicolon, what other problem is the
> do/while construct supposed to address?  I seem to recall there being
> another problem case, but I can't remember what it is.

For that particular #define, I can't think of any problem cases.  The
do/while helps with multiple statements, gives you a new scope for
variable declaration, and allows the code to do a break, but we don't
need any of that here.

-jim

[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux