Messages in this thread | | | Date | Tue, 8 Apr 2008 01:20:04 -0700 | From | Andrew Morton <> | 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@gmail.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.
| |