[PATCH] staging: sm750fb: remove unused variables

Subsystems: staging - silicon motion sm750 frame buffer driver, staging subsystem, the rest

STALE4060d

4 messages, 3 authors, 2015-06-23 · open the first message on its own page

[PATCH] staging: sm750fb: remove unused variables

From: Gujulan Elango, Hari Prasath (H.) <hidden>
Date: 2015-06-22 07:26:25

From: Hari Prasath Gujulan Elango <redacted>

This patch removes unused variables as reported by cppcheck

Signed-off-by: Hari Prasath Gujulan Elango <redacted>
---
 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(-)
diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
index f4975d2..e8ac6e6 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -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));
diff --git a/drivers/staging/sm750fb/ddk750_mode.c b/drivers/staging/sm750fb/ddk750_mode.c
index 74313ff..e67e1e9 100644
--- a/drivers/staging/sm750fb/ddk750_mode.c
+++ b/drivers/staging/sm750fb/ddk750_mode.c
@@ -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);
diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c
index b6395b8..2ac3470 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.c
+++ b/drivers/staging/sm750fb/ddk750_sii164.c
@@ -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. */
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in

Re: [PATCH] staging: sm750fb: remove unused variables

From: Dan Carpenter <hidden>
Date: 2015-06-23 08:46:13

On Mon, Jun 22, 2015 at 07:26:25AM +0000, Gujulan Elango, Hari Prasath (H.) wrote:
quoted hunk
@@ -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

Re: [PATCH] staging: sm750fb: remove unused variables

From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Date: 2015-06-23 10:12:47

On Tue, Jun 23, 2015 at 11:46:13AM +0300, Dan Carpenter wrote:
On Mon, Jun 22, 2015 at 07:26:25AM +0000, Gujulan Elango, Hari Prasath (H.) wrote:
quoted
@@ -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.
I think it should be kept, atleast for now. some members of pll are
modified in the function.

regards
sudip

Re: [PATCH] staging: sm750fb: remove unused variables

From: Gujulan Elango, Hari Prasath (H.) <hidden>
Date: 2015-06-23 13:05:06


On Tuesday 23 June 2015 02:16 PM, Dan Carpenter wrote:
On Mon, Jun 22, 2015 at 07:26:25AM +0000, Gujulan Elango, Hari Prasath (H.) wrote:
quoted
@@ -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
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.


-- 
thanks & regards,
Hari Prasath
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help