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]

 



> Maybe I missed this, but is there any reason for the patch, other then 
> a personal preference of how to do macros that look like functions? 
> I've seen gcc do strange non-optimal things with functions declared
> inlines, but I've never seen it generate bad code WRT to do{}while(0)
> constructs.
> 
> Unless I'm missing something, this patch looks like a solution in search
> of a problem...

In the case of set_io_port_base, I see no real reason.  But for the
out[b,w,l] functions, having the do/while can prevent constructs that
might otherwise make sense, like

	for(i=0;i<10;i++,outb(i,port)) {
           ...
        }

Okay, so it's a bad example, but.. :)  Maybe Brad has a better one.

-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