Re: [PATCH 1/3] drivers/misc: Add realtek card reader core driver

Dan Carpenter
2012-07-23T11:18:14Z

On Mon, Jul 23, 2012 at 05:42:38PM +0800, wei_wang@realsil.com.cn wrote:
> +
> +#define wait_timeout_x(task_state, msecs) \
> +do { \
> + set_current_state((task_state)); \
> + schedule_timeout(msecs_to_jiffies(msecs)); \
> +} while (0)
> +
> +#define wait_timeout(msecs) wait_timeout_x(TASK_INTERRUPTIBLE, (msecs))
> +
> +#define GET_BE32(ptr) (((u32)((ptr)[0]) << 24) | ((u32)((ptr)[1]) << 16) | \
> + ((u32)((ptr)[2]) << 8) | (ptr)[3])
> +

This will break on big endian systems. Use be32_to_cpu().

Use Sparse to check your work:
http://lwn.net/Articles/205624/

regards,
dan carpenter