Re: [PATCH] Staging: cx25821 : fix coding style issues in cx25821-alsa.c

Previous thread: [RFC PATCH 0/6] fuse: implement zero copy read by Miklos Szeredi on Wednesday, April 28, 2010 - 9:16 am. (7 messages)

Next thread: [PATCH] Staging: dt3155: Cleanup memory mapped i/o access by H Hartley Sweeten on Wednesday, April 28, 2010 - 10:23 am. (26 messages)
From: sai
Date: Wednesday, April 28, 2010 - 10:17 am

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
@@ -29,7 +29,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 
-#include <asm/delay.h>
+#include <linux/delay.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
@@ -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)
 
 /****************************************************************************
@@ -105,7 +105,7 @@ MODULE_PARM_DESC(index, "Index value for cx25821 capture interface(s).");
 MODULE_DESCRIPTION("ALSA driver module for cx25821 based capture cards");
 MODULE_AUTHOR("Hiep Huynh");
 MODULE_LICENSE("GPL");
-MODULE_SUPPORTED_DEVICE("{{Conexant,25821}");	//"{{Conexant,23881},"
+MODULE_SUPPORTED_DEVICE("{{Conexant,25821}");	/* "{{Conexant,23881}," */
 
 static unsigned int debug;
 module_param(debug, int, 0644);
@@ -135,7 +135,7 @@ MODULE_PARM_DESC(debug, "enable debug messages");
  * BOARD Specific: Sets audio DMA
  */
 
-static int _cx25821_start_audio_dma(snd_cx25821_card_t * chip)
+static int _cx25821_start_audio_dma(snd_cx25821_card_t *chip)
 {
 	struct cx25821_buffer *buf = chip->buf;
 	struct cx25821_dev *dev = chip->dev;
@@ -143,7 +143,7 @@ static ...
From: Joe Perches
Date: Wednesday, April 28, 2010 - 10:26 am

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)


--

Previous thread: [RFC PATCH 0/6] fuse: implement zero copy read by Miklos Szeredi on Wednesday, April 28, 2010 - 9:16 am. (7 messages)

Next thread: [PATCH] Staging: dt3155: Cleanup memory mapped i/o access by H Hartley Sweeten on Wednesday, April 28, 2010 - 10:23 am. (26 messages)