[PATCH v2] staging: mt7621-mmc: Fix debug macros in dbg.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixed four debug macros by replacing printk with dev_<level>
without __func__ or __LINE__ or current->comm and current->pid.
Further removed the do {} while(0) loop for single statement
macro. Issues found by checkpatch.

Signed-off-by: Nishad Kamdar <nishadkamdar@xxxxxxxxx>
---
Changes in v2:
  - Replace printk with dev_<level>.
  - Remove __func__, __LINE__, current->comm, current->pid from arguments.
  - Remove the do {} while(0) loop from these macros.
  - Modify commit message to include other changes.
---
 drivers/staging/mt7621-mmc/dbg.h | 26 +++++++-------------------
 1 file changed, 7 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/mt7621-mmc/dbg.h b/drivers/staging/mt7621-mmc/dbg.h
index 2f2c56b73987..e8091db3c1d6 100644
--- a/drivers/staging/mt7621-mmc/dbg.h
+++ b/drivers/staging/mt7621-mmc/dbg.h
@@ -104,19 +104,13 @@ do { \
 
 #define N_MSG(evt, fmt, args...)
 /*
-do {    \
-    if ((DBG_EVT_##evt) & sd_debug_zone[host->id]) { \
-        printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \
-            host->id,  ##args , __FUNCTION__, __LINE__, current->comm, current->pid);	\
-    } \
-} while(0)
-*/
+ *if ((DBG_EVT_##evt) & sd_debug_zone[host->id]) { \
+ *    dev_err(mmc_dev(host->mmc), "%d -> " fmt "\n", host->id, ##args) \
+ *}
+ */
 
 #define ERR_MSG(fmt, args...) \
-do { \
-	printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \
-	       host->id,  ##args, __FUNCTION__, __LINE__, current->comm, current->pid); \
-} while (0);
+dev_err(mmc_dev(host->mmc), "%d -> " fmt "\n", host->id, ##args)
 
 #if 1
 //defined CONFIG_MTK_MMC_CD_POLL
@@ -124,17 +118,11 @@ do { \
 #define IRQ_MSG(fmt, args...)
 #else
 #define INIT_MSG(fmt, args...) \
-do { \
-	printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d> PID<%s><0x%x>\n", \
-	       host->id,  ##args, __FUNCTION__, __LINE__, current->comm, current->pid); \
-} while (0);
+dev_err(mmc_dev(host->mmc), "%d -> " fmt "\n", host->id, ##args)
 
 /* PID in ISR in not corrent */
 #define IRQ_MSG(fmt, args...) \
-do { \
-	printk(KERN_ERR TAG"%d -> "fmt" <- %s() : L<%d>\n",	\
-	       host->id,  ##args, __FUNCTION__, __LINE__);	\
-} while (0);
+dev_err(mmc_dev(host->mmc), "%d -> " fmt "\n", host->id, ##args)
 #endif
 
 void msdc_debug_proc_init(void);
-- 
2.17.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux