From: Joe Perches on
On Wed, 2010-04-28 at 22:47 +0530, sai wrote:
> This is a patch to cx25821-alsa.c file that fixes of most of the warning & errors found by checkpatch.pl tool
> Signed-off-by: sai gopal <tsg321(a)gmail.com>
> ---
> drivers/staging/cx25821/cx25821-alsa.c | 75 +++++++++++++++++---------------
> 1 files changed, 40 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/staging/cx25821/cx25821-alsa.c b/drivers/staging/cx25821/cx25821-alsa.c
> index 061add3..0890384 100644
> --- a/drivers/staging/cx25821/cx25821-alsa.c
> +++ b/drivers/staging/cx25821/cx25821-alsa.c
[]
> @@ -42,10 +42,10 @@
>
> #define AUDIO_SRAM_CHANNEL SRAM_CH08
>
> -#define dprintk(level,fmt, arg...) if (debug >= level) \
> +#define dprintk(level, fmt, arg...) if (debug >= level) \
> printk(KERN_INFO "%s/1: " fmt, chip->dev->name , ## arg)
>
> -#define dprintk_core(level,fmt, arg...) if (debug >= level) \
> +#define dprintk_core(level, fmt, arg...) if (debug >= level) \
> printk(KERN_DEBUG "%s/1: " fmt, chip->dev->name , ## arg)

These macros should really be do {macro} while (0)
so that they can be simply used in an if/else

#define dprintk(level, fmt, arg...) \
do { \
if (debug >= level) \
printk(KERN_INFO "%s/1: " fmt, chip->dev->name, ##arg); \
} while (0)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/