Skip to contentSkip to conversation

staging: mt7621-mmc: Fix debug macros and their usages

PATCH Superseded Nishad Kamdar 2 participants 4 messages Sep 15, 2018 – Sep 19, 2018

Subsystems (2)

v7 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v7 cover staging: mt7621-mmc: Fix debug macros and their usages

This patch fixes the the debug macro IRQ_MSG().
It deletes IRQ_MSG() and all its users as currently it is a no-op.

Changes in v7:
- Delete IRQ_MSG() macro and its users.
- Patchset reduced to 1 patch as the patches fixing N_MSG() and ERR_MSG() have been accepted.

Changes in v6:
- Delete N_MSG() macro and its users as it is a no-op.
- Patchset reduced to 3 patches as the INIT_MSG patch is accepted.

Changes in v5:
- Remove commented code for N_MSG().
- Remove commented ERR_MSG() usages.

Changes in v4:
- Create multiple patches, one for each type of macro being deleted/changed.

Changes in v3:
- Replace usages of ERR_MSG and IRQ_MSG with dev_err() in code itself.
- Remove all INIT_MSG usages.
- Drop ERR_MSG, INIT_MSG and IRQ_MSG from dbg.h.

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.

Nishad Kamdar (1):
staging: mt7621-mmc: Delete IRQ_MSG() and its users

 drivers/staging/mt7621-mmc/dbg.h | 12 ------------
 drivers/staging/mt7621-mmc/sd.c  | 19 -------------------
 2 files changed, 31 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v7 1/1 staging: mt7621-mmc: Delete IRQ_MSG() and its users.

This patch removes IRQ_MSG() and its users as currently it is a no-op.

---
Changes in v7:
- Delete IRQ_MSG() and all its users
Changes in v6:
- No change
Changes in v5:
- No change

---
 drivers/staging/mt7621-mmc/dbg.h | 12 ------------
 drivers/staging/mt7621-mmc/sd.c  | 19 -------------------
 2 files changed, 31 deletions(-)
drivers/staging/mt7621-mmc/dbg.h +0 -12
index 79914d98c573..4ab9f10dccc2 100644
@@ -102,18 +102,6 @@ do { \
 } while (0)
 #endif /* end of +++ */
 
-#if 1
-//defined CONFIG_MTK_MMC_CD_POLL
-#define IRQ_MSG(fmt, args...)
-#else
-/* 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);
-#endif
-
 void msdc_debug_proc_init(void);
 
 #if 0 /* --- chhung */
drivers/staging/mt7621-mmc/sd.c +0 -19
index 7474f9ed7b5b..273593427d3a 100644
@@ -278,8 +278,6 @@ static void msdc_tasklet_card(struct work_struct *work)
 		host->mmc->f_max = HOST_MAX_MCLK;
 		mmc_detect_change(host->mmc, msecs_to_jiffies(20));
 	}
-
-	IRQ_MSG("card found<%s>", inserted ? "inserted" : "removed");
 #endif
 
 	spin_unlock(&host->lock);
@@ -1638,17 +1636,10 @@ static irqreturn_t msdc_irq(int irq, void *dev_id)
 	if (intsts & MSDC_INT_CDSC) {
 		if (host->mmc->caps & MMC_CAP_NEEDS_POLL)
 			return IRQ_HANDLED;
-		IRQ_MSG("MSDC_INT_CDSC irq<0x%.8x>", intsts);
 		schedule_delayed_work(&host->card_delaywork, HZ);
 		/* tuning when plug card ? */
 	}
 
-	/* sdio interrupt */
-	if (intsts & MSDC_INT_SDIOIRQ) {
-		IRQ_MSG("XXX MSDC_INT_SDIOIRQ");  /* seems not sdio irq */
-		//mmc_signal_sdio_irq(host->mmc);
-	}
-
 	/* transfer complete interrupt */
 	if (data != NULL) {
 		if (inten & MSDC_INT_XFER_COMPL) {
@@ -1663,10 +1654,8 @@ static irqreturn_t msdc_irq(int irq, void *dev_id)
 			msdc_clr_int();
 
 			if (intsts & MSDC_INT_DATTMO) {
-				IRQ_MSG("XXX CMD<%d> MSDC_INT_DATTMO", host->mrq->cmd->opcode);
 				data->error = -ETIMEDOUT;
 			} else if (intsts & MSDC_INT_DATCRCERR) {
-				IRQ_MSG("XXX CMD<%d> MSDC_INT_DATCRCERR, SDC_DCRC_STS<0x%x>", host->mrq->cmd->opcode, readl(host->base + SDC_DCRC_STS));
 				data->error = -EIO;
 			}
 
@@ -1698,16 +1687,8 @@ static irqreturn_t msdc_irq(int irq, void *dev_id)
 				break;
 			}
 		} else if ((intsts & MSDC_INT_RSPCRCERR) || (intsts & MSDC_INT_ACMDCRCERR)) {
-			if (intsts & MSDC_INT_ACMDCRCERR)
-				IRQ_MSG("XXX CMD<%d> MSDC_INT_ACMDCRCERR", cmd->opcode);
-			else
-				IRQ_MSG("XXX CMD<%d> MSDC_INT_RSPCRCERR", cmd->opcode);
 			cmd->error = -EIO;
 		} else if ((intsts & MSDC_INT_CMDTMO) || (intsts & MSDC_INT_ACMDTMO)) {
-			if (intsts & MSDC_INT_ACMDTMO)
-				IRQ_MSG("XXX CMD<%d> MSDC_INT_ACMDTMO", cmd->opcode);
-			else
-				IRQ_MSG("XXX CMD<%d> MSDC_INT_CMDTMO", cmd->opcode);
 			cmd->error = -ETIMEDOUT;
 			msdc_reset_hw(host);
 			msdc_clr_fifo(host);
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH v7 1/1] staging: mt7621-mmc: Delete IRQ_MSG() and its users.

Quoted 70 lines · Nishad Kamdar

This patch removes IRQ_MSG() and its users as currently it is a no-op.

---
Changes in v7:
- Delete IRQ_MSG() and all its users
Changes in v6:
- No change
Changes in v5:
- No change

---
 drivers/staging/mt7621-mmc/dbg.h | 12 ------------
 drivers/staging/mt7621-mmc/sd.c  | 19 -------------------
 2 files changed, 31 deletions(-)
drivers/staging/mt7621-mmc/dbg.h +0 -12
index 79914d98c573..4ab9f10dccc2 100644
@@ -102,18 +102,6 @@ do { \
 } while (0)
 #endif /* end of +++ */
 
-#if 1
-//defined CONFIG_MTK_MMC_CD_POLL
-#define IRQ_MSG(fmt, args...)
-#else
-/* 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);
-#endif
-
 void msdc_debug_proc_init(void);
 
 #if 0 /* --- chhung */
drivers/staging/mt7621-mmc/sd.c +0 -9
index 7474f9ed7b5b..273593427d3a 100644
@@ -278,8 +278,6 @@ static void msdc_tasklet_card(struct work_struct *work)
 		host->mmc->f_max = HOST_MAX_MCLK;
 		mmc_detect_change(host->mmc, msecs_to_jiffies(20));
 	}
-
-	IRQ_MSG("card found<%s>", inserted ? "inserted" : "removed");
 #endif
 
 	spin_unlock(&host->lock);
@@ -1638,17 +1636,10 @@ static irqreturn_t msdc_irq(int irq, void *dev_id)
 	if (intsts & MSDC_INT_CDSC) {
 		if (host->mmc->caps & MMC_CAP_NEEDS_POLL)
 			return IRQ_HANDLED;
-		IRQ_MSG("MSDC_INT_CDSC irq<0x%.8x>", intsts);
 		schedule_delayed_work(&host->card_delaywork, HZ);
 		/* tuning when plug card ? */
 	}
 
-	/* sdio interrupt */
-	if (intsts & MSDC_INT_SDIOIRQ) {
-		IRQ_MSG("XXX MSDC_INT_SDIOIRQ");  /* seems not sdio irq */
-		//mmc_signal_sdio_irq(host->mmc);
-	}
-
 	/* transfer complete interrupt */
 	if (data != NULL) {
 		if (inten & MSDC_INT_XFER_COMPL) {

drivers/staging/mt7621-mmc/sd.c static irqreturn_t msdc_irq(int irq, void *dev_id) · line 1660

Quoted 9 lines
drivers/staging/mt7621-mmc/sd.c +0 -2
@@ -1663,10 +1654,8 @@ static irqreturn_t msdc_irq(int irq, void *dev_id)
 			msdc_clr_int();
 
 			if (intsts & MSDC_INT_DATTMO) {
-				IRQ_MSG("XXX CMD<%d> MSDC_INT_DATTMO", host->mrq->cmd->opcode);
 				data->error = -ETIMEDOUT;
 			} else if (intsts & MSDC_INT_DATCRCERR) {
-				IRQ_MSG("XXX CMD<%d> MSDC_INT_DATCRCERR, SDC_DCRC_STS<0x%x>", host->mrq->cmd->opcode, readl(host->base + SDC_DCRC_STS));
 				data->error = -EIO;
 			}

The {} should be removed here, right?

thanks,

greg k-h

#3 lore raw

Re: [PATCH v7 1/1] staging: mt7621-mmc: Delete IRQ_MSG() and its users.

Quoted 83 lines · Greg Kroah-Hartman
Quoted 70 lines · Nishad Kamdar

This patch removes IRQ_MSG() and its users as currently it is a no-op.

---
Changes in v7:
- Delete IRQ_MSG() and all its users
Changes in v6:
- No change
Changes in v5:
- No change

---
 drivers/staging/mt7621-mmc/dbg.h | 12 ------------
 drivers/staging/mt7621-mmc/sd.c  | 19 -------------------
 2 files changed, 31 deletions(-)
drivers/staging/mt7621-mmc/dbg.h +0 -12
index 79914d98c573..4ab9f10dccc2 100644
@@ -102,18 +102,6 @@ do { \
 } while (0)
 #endif /* end of +++ */
 
-#if 1
-//defined CONFIG_MTK_MMC_CD_POLL
-#define IRQ_MSG(fmt, args...)
-#else
-/* 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);
-#endif
-
 void msdc_debug_proc_init(void);
 
 #if 0 /* --- chhung */
drivers/staging/mt7621-mmc/sd.c +0 -9
index 7474f9ed7b5b..273593427d3a 100644
@@ -278,8 +278,6 @@ static void msdc_tasklet_card(struct work_struct *work)
 		host->mmc->f_max = HOST_MAX_MCLK;
 		mmc_detect_change(host->mmc, msecs_to_jiffies(20));
 	}
-
-	IRQ_MSG("card found<%s>", inserted ? "inserted" : "removed");
 #endif
 
 	spin_unlock(&host->lock);
@@ -1638,17 +1636,10 @@ static irqreturn_t msdc_irq(int irq, void *dev_id)
 	if (intsts & MSDC_INT_CDSC) {
 		if (host->mmc->caps & MMC_CAP_NEEDS_POLL)
 			return IRQ_HANDLED;
-		IRQ_MSG("MSDC_INT_CDSC irq<0x%.8x>", intsts);
 		schedule_delayed_work(&host->card_delaywork, HZ);
 		/* tuning when plug card ? */
 	}
 
-	/* sdio interrupt */
-	if (intsts & MSDC_INT_SDIOIRQ) {
-		IRQ_MSG("XXX MSDC_INT_SDIOIRQ");  /* seems not sdio irq */
-		//mmc_signal_sdio_irq(host->mmc);
-	}
-
 	/* transfer complete interrupt */
 	if (data != NULL) {
 		if (inten & MSDC_INT_XFER_COMPL) {

drivers/staging/mt7621-mmc/sd.c static irqreturn_t msdc_irq(int irq, void *dev_id) · line 1660

Quoted 9 lines
drivers/staging/mt7621-mmc/sd.c +0 -2
@@ -1663,10 +1654,8 @@ static irqreturn_t msdc_irq(int irq, void *dev_id)
 			msdc_clr_int();
 
 			if (intsts & MSDC_INT_DATTMO) {
-				IRQ_MSG("XXX CMD<%d> MSDC_INT_DATTMO", host->mrq->cmd->opcode);
 				data->error = -ETIMEDOUT;
 			} else if (intsts & MSDC_INT_DATCRCERR) {
-				IRQ_MSG("XXX CMD<%d> MSDC_INT_DATCRCERR, SDC_DCRC_STS<0x%x>", host->mrq->cmd->opcode, readl(host->base + SDC_DCRC_STS));
 				data->error = -EIO;
 			}

The {} should be removed here, right?

Quoted 3 lines

thanks,

greg k-h

Yes, i'll do that.

Thanks for the review.

regards,
nishad