lkml.org 
[lkml]   [2008]   [Apr]   [8]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateTue, 8 Apr 2008 01:20:04 -0700
FromAndrew Morton <>
SubjectRe: [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.




\
 
 \ /
  Last update: 2008-04-08 10:23    [from the cache]
©2003-2008