[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080408012004.013a2572.akpm@linux-foundation.org>
Date: Tue, 8 Apr 2008 01:20:04 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: "eric miao" <eric.y.miao@...il.com>
Cc: "linux-arm-kernel email list"
<linux-arm-kernel@...ts.arm.linux.org.uk>,
linux-fbdev-devel@...ts.sourceforge.net,
lkml <linux-kernel@...r.kernel.org>,
"Russell King - ARM Linux" <linux@....linux.org.uk>
Subject: Re: [PATCH 1/4] pxafb: introduce lcd_{read,write}l() to wrap the
__raw_{read,write}l()
On Tue, 8 Apr 2008 12:03:16 +0800 "eric miao" <eric.y.miao@...il.com> wrote:
> +#define lcd_readl(f, off) __raw_readl((f)->mmio_base + (off))
> +#define lcd_writel(f, off, v) __raw_writel((v), (f)->mmio_base + (off))
Please implement things like this in C. Probably inlined.
Advantages:
- C looks nicer
- For some reason people are more likely to document their C than their macros
- macros can sometimes reference their argument multiple times, causing
bugs when they are passed experssions with side-effects.
- C functions have typechecking
- C functions (whether inlined or not) count as a reference to their
argument, and can help to avoid unused-variable warnings.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists