Re: FlashPoint card hanging system (BT-950)

William Lash (welash@xnet.com)
Sun, 3 Oct 1999 14:51:12 -0500 (CDT)


>
> On Sat, Oct 02, 1999 at 04:34:14PM -0500, William Lash wrote:
> > I am not competely convinced that the way I added the udelay() call to the
> > macros is 100% correct. I changed
> >
> > #define OS_InPortByte(port) inb(port)
> >
> > to:
> >
> > #define OS_InPortByte(port) (udelay(2),inb(port))
>
> Better (more usual) is:
>
> #define OS_InPortByte(port) do { udelay(2); inb(port); } while (0)

Hmm, this would probably work for the OS_Out* macros, but for the OS_In*
macros I don't think it evaluates to the result returned by inb(port).
The comma operator returns the correct value, but I am not 100% sure that
it is guaranteed to call the two functions in a let to right order. I
suppose that the OS_* macros could be redefined as inline functions to
guarantee the proper behavior.

Bill Lash
welash@xnet.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/