* [PATCH v2] video: fbdev: sis: init.c: Cleaning up variable that is never used
@ 2014-07-07 20:23 Rickard Strandqvist
2014-07-08 5:59 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Rickard Strandqvist @ 2014-07-07 20:23 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
Cc: Rickard Strandqvist, Jingoo Han, Daniel Vetter,
Mauro Carvalho Chehab, Chen, Gong, Dan Carpenter, linux-fbdev,
linux-kernel
Variable ar assigned a value that is 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@spectrumdigital.se>
---
drivers/video/fbdev/sis/init.c | 26 ++++++--------------------
1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/drivers/video/fbdev/sis/init.c b/drivers/video/fbdev/sis/init.c
index bd40f5e..1948b623 100644
--- a/drivers/video/fbdev/sis/init.c
+++ b/drivers/video/fbdev/sis/init.c
@@ -2649,7 +2649,7 @@ static void
SiS_SetCRT1ModeRegs(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
unsigned short ModeIdIndex, unsigned short RRTI)
{
- unsigned short data, infoflag = 0, modeflag, resindex;
+ unsigned short data, infoflag = 0, modeflag;
#ifdef CONFIG_FB_SIS_315
unsigned char *ROMAddr = SiS_Pr->VirtualRomBase;
unsigned short data2, data3;
@@ -2659,11 +2659,8 @@ SiS_SetCRT1ModeRegs(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
if(SiS_Pr->UseCustomMode) {
infoflag = SiS_Pr->CInfoFlag;
- } else {
- resindex = SiS_GetResInfo(SiS_Pr, ModeNo, ModeIdIndex);
- if(ModeNo > 0x13) {
- infoflag = SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag;
- }
+ } else if (ModeNo > 0x13) {
+ infoflag = SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag;
}
/* Disable DPMS */
@@ -3539,16 +3536,15 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
struct fb_var_screeninfo *var, bool writeres
)
{
- unsigned short HRE, HBE, HRS, HBS, HDE, HT;
- unsigned short VRE, VBE, VRS, VBS, VDE, VT;
+ unsigned short HRE, HBE, HRS, HDE, HT;
+ unsigned short VRE, VBE, VRS, VDE, VT;
unsigned char sr_data, cr_data, cr_data2;
- int A, B, C, D, E, F, temp;
+ int B, C, D, E, F, temp;
sr_data = crdata[14];
/* Horizontal total */
HT = crdata[0] | ((unsigned short)(sr_data & 0x03) << 8);
- A = HT + 5;
/* Horizontal display enable end */
HDE = crdata[1] | ((unsigned short)(sr_data & 0x0C) << 6);
@@ -3558,9 +3554,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
HRS = crdata[4] | ((unsigned short)(sr_data & 0xC0) << 2);
F = HRS - E - 3;
- /* Horizontal blank start */
- HBS = crdata[2] | ((unsigned short)(sr_data & 0x30) << 4);
-
sr_data = crdata[15];
cr_data = crdata[5];
@@ -3594,7 +3587,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
((unsigned short)(cr_data & 0x01) << 8) |
((unsigned short)(cr_data & 0x20) << 4) |
((unsigned short)(sr_data & 0x01) << 10);
- A = VT + 2;
/* Vertical display enable end */
VDE = crdata[10] |
@@ -3612,12 +3604,6 @@ SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
cr_data2 = (crdata[16] & 0x01) << 5;
- /* Vertical blank start */
- VBS = crdata[11] |
- ((unsigned short)(cr_data & 0x08) << 5) |
- ((unsigned short)(cr_data2 & 0x20) << 4) |
- ((unsigned short)(sr_data & 0x04) << 8);
-
/* Vertical blank end */
VBE = crdata[12] | ((unsigned short)(sr_data & 0x10) << 4);
temp = VBE - ((E - 1) & 511);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] video: fbdev: sis: init.c: Cleaning up variable that is never used
2014-07-07 20:23 [PATCH v2] video: fbdev: sis: init.c: Cleaning up variable that is never used Rickard Strandqvist
@ 2014-07-08 5:59 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2014-07-08 5:59 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, Jingoo Han,
Daniel Vetter, Mauro Carvalho Chehab, Chen, Gong, linux-fbdev,
linux-kernel
On Mon, Jul 07, 2014 at 10:23:47PM +0200, Rickard Strandqvist wrote:
> Variable ar assigned a value that is 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@spectrumdigital.se>
Thanks.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-08 5:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-07 20:23 [PATCH v2] video: fbdev: sis: init.c: Cleaning up variable that is never used Rickard Strandqvist
2014-07-08 5:59 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).