linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: eric miao <eric.y.miao@gmail.com>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>,
	linux-fbdev-devel@lists.sourceforge.net,
	linux-arm-kernel email list
	<linux-arm-kernel@lists.arm.linux.org.uk>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/4] pxafb: introduce lcd_{read, write}l() to wrap the __raw_{read, write}l()
Date: Tue, 8 Apr 2008 01:20:04 -0700	[thread overview]
Message-ID: <20080408012004.013a2572.akpm@linux-foundation.org> (raw)
In-Reply-To: <f17812d70804072103s4fa2b6d4t57abfcda9d8e0b11@mail.gmail.com>

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.



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

  reply	other threads:[~2008-04-08  8:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-08  4:03 [PATCH 1/4] pxafb: introduce lcd_{read, write}l() to wrap the __raw_{read, write}l() eric miao
2008-04-08  8:20 ` Andrew Morton [this message]
2008-04-08 10:13   ` eric miao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080408012004.013a2572.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=eric.y.miao@gmail.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).