Skip to contentSkip to conversation

staging: sm750fb: Remove dead VALIDATION_CHIP preprocessor blocks

PATCH Superseded Mohit Mishra 2 participants 3 messages Jul 25

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 staging: sm750fb: Remove dead VALIDATION_CHIP preprocessor blocks

The macro VALIDATION_CHIP is not defined anywhere in the kernel source tree. Hence, '#ifdef VALIDATION_CHIP' blocks are dead code, and '#ifndef VALIDATION_CHIP' blocks are always active.

Remove the dead conditional blocks, keeping only the active paths, and clean up the unused macro definitions.

This addresses the first task in the drivers/staging/sm750fb/TODO list:
"- refine the code and remove unused code".

---
 drivers/staging/sm750fb/ddk750_chip.c  |  4 --
 drivers/staging/sm750fb/ddk750_power.c |  6 ---
 drivers/staging/sm750fb/ddk750_reg.h   | 60 ++++++--------------------
 3 files changed, 12 insertions(+), 58 deletions(-)
drivers/staging/sm750fb/ddk750_chip.c +0 -4
index aa78d0bc1d87..1b3d1467ddf0 100644
@@ -360,9 +360,7 @@ unsigned int sm750_calc_pll_value(unsigned int request_orig,
 
 unsigned int sm750_format_pll_reg(struct pll_value *p_PLL)
 {
-#ifndef VALIDATION_CHIP
 	unsigned int POD = p_PLL->POD;
-#endif
 	unsigned int OD = p_PLL->OD;
 	unsigned int M = p_PLL->M;
 	unsigned int N = p_PLL->N;
@@ -374,9 +372,7 @@ unsigned int sm750_format_pll_reg(struct pll_value *p_PLL)
 	 * applied to any PLL in the calling function.
 	 */
 	return PLL_CTRL_POWER |
-#ifndef VALIDATION_CHIP
 		((POD << PLL_CTRL_POD_SHIFT) & PLL_CTRL_POD_MASK) |
-#endif
 		((OD << PLL_CTRL_OD_SHIFT) & PLL_CTRL_OD_MASK) |
 		((N << PLL_CTRL_N_SHIFT) & PLL_CTRL_N_MASK) |
 		((M << PLL_CTRL_M_SHIFT) & PLL_CTRL_M_MASK);
drivers/staging/sm750fb/ddk750_power.c +0 -6
index eaba3bc2e01a..d617f554f58d 100644
@@ -58,14 +58,8 @@ void sm750_set_power_mode(unsigned int mode)
 	/* Set up other fields in Power Control Register */
 	if (mode == POWER_MODE_CTRL_MODE_SLEEP) {
 		ctrl &= ~POWER_MODE_CTRL_OSC_INPUT;
-#ifdef VALIDATION_CHIP
-		ctrl &= ~POWER_MODE_CTRL_336CLK;
-#endif
 	} else {
 		ctrl |= POWER_MODE_CTRL_OSC_INPUT;
-#ifdef VALIDATION_CHIP
-		ctrl |= POWER_MODE_CTRL_336CLK;
-#endif
 	}
 
 	/* Program new power mode. */
drivers/staging/sm750fb/ddk750_reg.h +12 -48

128 lines not on this page · raw message

Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/2 staging: sm750fb: Remove unused function sm750_enable_dma

The function sm750_enable_dma is defined in ddk750_power.c and declared in ddk750_power.h, but it is not called anywhere in the driver.

Remove the unused definition and declaration.

This addresses the first task in the drivers/staging/sm750fb/TODO list:
"- refine the code and remove unused code".

---
 drivers/staging/sm750fb/ddk750_power.c | 13 -------------
 drivers/staging/sm750fb/ddk750_power.h |  5 -----
 2 files changed, 18 deletions(-)
drivers/staging/sm750fb/ddk750_power.c +0 -13
index d617f554f58d..e4bea8da1827 100644
@@ -90,19 +90,6 @@ void sm750_enable_2d_engine(unsigned int enable)
 	sm750_set_current_gate(gate);
 }
 
-void sm750_enable_dma(unsigned int enable)
-{
-	u32 gate;
-
-	/* Enable DMA Gate */
-	gate = peek32(CURRENT_GATE);
-	if (enable)
-		gate |= CURRENT_GATE_DMA;
-	else
-		gate &= ~CURRENT_GATE_DMA;
-
-	sm750_set_current_gate(gate);
-}
 
 /*
  * This function enable/disable the GPIO Engine
drivers/staging/sm750fb/ddk750_power.h +0 -5
index 1c4f054d7276..0c4ab2120385 100644
@@ -23,11 +23,6 @@ void sm750_set_current_gate(unsigned int gate);
  */
 void sm750_enable_2d_engine(unsigned int enable);
 
-/*
- * This function enable/disable the DMA Engine
- */
-void sm750_enable_dma(unsigned int enable);
-
 /*
  * This function enable/disable the GPIO Engine
  */
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH 2/2] staging: sm750fb: Remove unused function sm750_enable_dma

Quoted 12 lines · Mohit Mishra
drivers/staging/sm750fb/ddk750_power.c +0 -4
index d617f554f58d..e4bea8da1827 100644
@@ -90,19 +90,6 @@ void sm750_enable_2d_engine(unsigned int enable)
 	sm750_set_current_gate(gate);
 }
 
-void sm750_enable_dma(unsigned int enable)
-{
-	u32 gate;
-

drivers/staging/sm750fb/ddk750_power.c void sm750_enable_2d_engine(unsigned int enable) · line 93

Quoted 10 lines
drivers/staging/sm750fb/ddk750_power.c +0 -9
-	/* Enable DMA Gate */
-	gate = peek32(CURRENT_GATE);
-	if (enable)
-		gate |= CURRENT_GATE_DMA;
-	else
-		gate &= ~CURRENT_GATE_DMA;
-
-	sm750_set_current_gate(gate);
-}
 

You need to delete the blank line afterwards as well otherwise there are two blank lines in a row and checkpatch.pl -f will complain:

CHECK: Please don't use multiple blank lines #93: FILE: drivers/staging/sm750fb/ddk750_power.c:93:
+
+

regards,
dan carpenter