[PATCH] staging: xgifb: vb_setmode: Removed variables that is never used

Rickard Strandqvist rickard_strandqvist at spectrumdigital.se
Sat Jan 31 15:21:46 UTC 2015


Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist at spectrumdigital.se>
---
 drivers/staging/xgifb/vb_setmode.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c
index 1f6f699..6eb8c55 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -730,7 +730,6 @@ static void XGI_SetCRT1DE(unsigned short ModeIdIndex,
 		tempax |= 0x40;
 
 	xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x42, tempax);
-	data = xgifb_reg_get(pVBInfo->P3d4, 0x07);
 	tempax = 0;
 
 	if (tempbx & 0x04)
@@ -2245,9 +2244,8 @@ static unsigned char XGI_XG27GetPSCValue(struct vb_device_info *pVBInfo)
 static void XGI_XG21BLSignalVDD(unsigned short tempbh, unsigned short tempbl,
 		struct vb_device_info *pVBInfo)
 {
-	unsigned char CR4A, temp;
+	unsigned char temp;
 
-	CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A);
 	tempbh &= 0x23;
 	tempbl &= 0x23;
 	xgifb_reg_and(pVBInfo->P3d4, 0x4A, ~tempbh); /* enable GPIO write */
@@ -2271,7 +2269,7 @@ static void XGI_XG21BLSignalVDD(unsigned short tempbh, unsigned short tempbl,
 static void XGI_XG27BLSignalVDD(unsigned short tempbh, unsigned short tempbl,
 		struct vb_device_info *pVBInfo)
 {
-	unsigned char CR4A, temp;
+	unsigned char temp;
 	unsigned short tempbh0, tempbl0;
 
 	tempbh0 = tempbh;
@@ -2290,7 +2288,6 @@ static void XGI_XG27BLSignalVDD(unsigned short tempbh, unsigned short tempbl,
 	}
 	xgifb_reg_and_or(pVBInfo->P3d4, 0xB4, ~tempbh0, tempbl0);
 
-	CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A);
 	tempbh &= 0x03;
 	tempbl &= 0x03;
 	tempbh <<= 2;
@@ -5160,7 +5157,7 @@ unsigned short XGI_GetRatePtrCRT2(struct xgi_hw_device_info *pXGIHWDE,
 	}
 	i--;
 	if ((pVBInfo->SetFlag & ProgrammingCRT2)) {
-		temp = XGI_AjustCRT2Rate(ModeIdIndex, RefreshRateTableIndex,
+		XGI_AjustCRT2Rate(ModeIdIndex, RefreshRateTableIndex,
 					 &i, pVBInfo);
 	}
 	return RefreshRateTableIndex + i;
-- 
1.7.10.4



More information about the devel mailing list