Skip to contentSkip to conversation

staging: sm750fb: remove unused variables

PATCH In review Gujulan Elango, Hari Prasath (H.) 3 participants 4 messages Jun 22, 2015 – Jun 23, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: sm750fb: remove unused variables

From: Hari Prasath Gujulan Elango <[email protected]>

This patch removes unused variables as reported by cppcheck

---
 drivers/staging/sm750fb/ddk750_chip.c   | 3 +--
 drivers/staging/sm750fb/ddk750_mode.c   | 3 +--
 drivers/staging/sm750fb/ddk750_sii164.c | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)
drivers/staging/sm750fb/ddk750_chip.c +1 -2
index f4975d2..e8ac6e6 100644
@@ -103,7 +103,6 @@ unsigned int getChipClock(void)
 void setChipClock(unsigned int frequency)
 {
 	pll_value_t pll;
-	unsigned int ulActualMxClk;
 #if 1
 	/* Cheok_0509: For SM750LE, the chip clock is fixed. Nothing to set. */
 	if (getChipType() = SM750LE)
@@ -122,7 +121,7 @@ void setChipClock(unsigned int frequency)
 		* Sometime, the chip cannot set up the exact clock required by User.
 		* Return value from calcPllValue() gives the actual possible clock.
 		*/
-		ulActualMxClk = calcPllValue(frequency, &pll);
+		calcPllValue(frequency, &pll);
 
 		/* Master Clock Control: MXCLK_PLL */
 		POKE32(MXCLK_PLL_CTRL, formatPllReg(&pll));
drivers/staging/sm750fb/ddk750_mode.c +1 -2
index 74313ff..e67e1e9 100644
@@ -188,11 +188,10 @@ static int programModeRegisters(mode_parameter_t *pModeParam, pll_value_t *pll)
 int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock)
 {
 	pll_value_t pll;
-	unsigned int uiActualPixelClk;
 	pll.inputFreq = DEFAULT_INPUT_CLOCK;
 	pll.clockType = clock;
 
-	uiActualPixelClk = calcPllValue(parm->pixel_clock, &pll);
+	calcPllValue(parm->pixel_clock, &pll);
 	if(getChipType() = SM750LE){
 		/* set graphic mode via IO method */
 		outb_p(0x88, 0x3d4);
drivers/staging/sm750fb/ddk750_sii164.c +1 -2
index b6395b8..2ac3470 100644
@@ -345,8 +345,7 @@ void sii164EnableHotPlugDetection(
     unsigned char enableHotPlug
 )
 {
-    unsigned char detectReg;
-    detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT);
+    i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT);
 
     /* Depending on each DVI controller, need to enable the hot plug based on each
        individual chip design. */
Signature · 3 lines
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
#1 lore raw

drivers/staging/sm750fb/ddk750_chip.c void setChipClock(unsigned int frequency) · line 124

Quoted 6 lines · Hari Prasath (H.)
drivers/staging/sm750fb/ddk750_chip.c +1 -1
@@ -122,7 +121,7 @@ void setChipClock(unsigned int frequency)
 		* Sometime, the chip cannot set up the exact clock required by User.
 		* Return value from calcPllValue() gives the actual possible clock.
 		*/
-		ulActualMxClk = calcPllValue(frequency, &pll);
+		calcPllValue(frequency, &pll);

Should we get rid of calcPllValue() as well? I guess I would prefer to leave the warnings until someone has the answer to this.

Warnings are good because they show where the bugs are. It's not always the right thing to silence them.

regards,
dan carpenter

maintainer
#2 lore raw
In reply to Gujulan Elango, Hari Prasath (H.)
Quoted 11 lines · Dan Carpenter

drivers/staging/sm750fb/ddk750_chip.c void setChipClock(unsigned int frequency) · line 124

Quoted 6 lines · Hari Prasath (H.)
drivers/staging/sm750fb/ddk750_chip.c +1 -1
@@ -122,7 +121,7 @@ void setChipClock(unsigned int frequency)
 		* Sometime, the chip cannot set up the exact clock required by User.
 		* Return value from calcPllValue() gives the actual possible clock.
 		*/
-		ulActualMxClk = calcPllValue(frequency, &pll);
+		calcPllValue(frequency, &pll);

Should we get rid of calcPllValue() as well? I guess I would prefer to leave the warnings until someone has the answer to this.

Quoted 2 lines

Warnings are good because they show where the bugs are. It's not always the right thing to silence them.

I think it should be kept, atleast for now. some members of pll are modified in the function.

regards
sudip

#3 lore raw
In reply to Gujulan Elango, Hari Prasath (H.)
Quoted 11 lines · Dan Carpenter

drivers/staging/sm750fb/ddk750_chip.c void setChipClock(unsigned int frequency) · line 124

Quoted 6 lines · Hari Prasath (H.)
drivers/staging/sm750fb/ddk750_chip.c +1 -1
@@ -122,7 +121,7 @@ void setChipClock(unsigned int frequency)
 		* Sometime, the chip cannot set up the exact clock required by User.
 		* Return value from calcPllValue() gives the actual possible clock.
 		*/
-		ulActualMxClk = calcPllValue(frequency, &pll);
+		calcPllValue(frequency, &pll);

Should we get rid of calcPllValue() as well? I guess I would prefer to leave the warnings until someone has the answer to this.

Quoted 7 lines

Warnings are good because they show where the bugs are. It's not always the right thing to silence them.

regards,
dan carpenter

Okay.Let us drop this patch and leave the warning as it is. Sudip,I saw your e-mail on the same topic. Thank you both for reviewing.

Signature · 2 lines
thanks & regards,
Hari Prasath