lkml.org 
[lkml]   [2010]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Staging: cx25821 : fix coding style issues in cx25821-alsa.c
From
Date
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@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)




\
 
 \ /
  Last update: 2010-04-28 19:29    [W:0.028 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site