staging: sm750fb: Remove dead VALIDATION_CHIP preprocessor blocks
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
@@ -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
@@ -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
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
@@ -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
@@ -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
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@@ -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