From: Andrei Konovalov <akonovalov@ru•mvista.com>
To: Arnd Bergmann <arnd@arndb•de>
Cc: rick.moleres@xilinx•com, linuxppc-embedded@ozlabs•org
Subject: Re: [PATCH] Xilinx framebuffer device driver - 2nd version
Date: Fri, 27 Apr 2007 01:55:20 +0400 [thread overview]
Message-ID: <46311FC8.9020906@ru.mvista.com> (raw)
In-Reply-To: <200704262235.22048.arnd@arndb.de>
Arnd Bergmann wrote:
>>@@ -118,6 +118,12 @@ struct xilinxfb_drvdata {
>> #define to_xilinxfb_drvdata(_info) \
>> container_of(_info, struct xilinxfb_drvdata, info)
>>
>>+#define xilinx_fb_out_be32(driverdata, offset, val) \
>>+ if (driverdata->use_dcr) \
>>+ mtdcr(driverdata->regs_phys + offset, val); \
>>+ else \
>>+ out_be32(driverdata->regs + offset, val)
>>+
>> static int
>> xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,
>> unsigned transp, struct fb_info *fbi)
>
>
> This should probably be an inline function, or use do { ... } while (0)
> instead, to make it less error-prone, see
> http://kernelnewbies.org/FAQ/DoWhile0 for an explanation.
>
> Arnd <><
xilinx_fb_out_be32 macro doesn't declare local variables, and is a single "line of code"
in terms of the web page you've referenced. IOW I can't get an example where this macro
would do wrong off the top of my head. Anyway, the do { ... } while (0) is safe and
common, so I'll regenerate the patch to use it.
Thanks a lot for reviewing that stuff!
Best regards,
Andrei
next prev parent reply other threads:[~2007-04-26 22:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-26 18:31 [PATCH] Xilinx framebuffer device driver - 2nd version Andrei Konovalov
2007-04-26 20:35 ` Arnd Bergmann
2007-04-26 21:55 ` Andrei Konovalov [this message]
2007-04-30 9:01 ` Grant Likely
2007-05-02 16:34 ` Andrei Konovalov
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=46311FC8.9020906@ru.mvista.com \
--to=akonovalov@ru$(echo .)mvista.com \
--cc=arnd@arndb$(echo .)de \
--cc=linuxppc-embedded@ozlabs$(echo .)org \
--cc=rick.moleres@xilinx$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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