[PATCH] Xilinx framebuffer device driver - 2nd version

Arnd Bergmann arnd at arndb.de
Fri Apr 27 06:35:21 EST 2007


> @@ -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 <><



More information about the Linuxppc-embedded mailing list