lkml.org 
[lkml]   [2008]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
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    [W:0.034 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site