linux-mips
[Top] [All Lists]

Re: fixup_bigphys_addr and DBAu1500 dev board

To: Jeff Baitis <baitisj@evolution.com>
Subject: Re: fixup_bigphys_addr and DBAu1500 dev board
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Sun, 23 Feb 2003 10:19:23 +0100 (MET)
Cc: Dan Malek <dan@embeddededge.com>, ppopov@mvista.com, Linux/MIPS Development <linux-mips@linux-mips.org>
In-reply-to: <20030221195031.I20129@luca.pas.lab>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
On Fri, 21 Feb 2003, Jeff Baitis wrote:
> -#define outw_p(val,port)                                               \
> -do {                                                                   \
> -       *(volatile u16 *)(mips_io_port_base + __swizzle_addr_w(port)) = \
> -               __ioswab16(val);                                        \
> -       SLOW_DOWN_IO;                                                   \
> -} while(0)
> +/* baitisj */
> +static inline u16 outw_p(u16 val, unsigned long port)
> +{
> +    register u16 retval;
> +    do {
> +        retval = *(volatile u16 *)(mips_io_port_base + 
> __swizzle_addr_w(port)) =
> +            __ioswab16(val);
> +        SLOW_DOWN_IO;
> +    } while(0);
> +    return retval;
> +}

You don't need the `do { ... } while (0)' construct in an inline function.

Gr{oetje,eeting}s,

                                                Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                                            -- Linus Torvalds


<Prev in Thread] Current Thread [Next in Thread>