Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

video: fbdev: sis: Fix set but not used warnings in init.c

Fix "set but not used" warnings by removing the code the assign the
variables and the definition of the variables.
A register read is kept as it may have unknown side-effects.

This removes a lot of unused code - which is always a good thing to do.

v2:
- Updated subject (Lee)

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Thomas Winischhofer <thomas@winischhofer.net>
Cc: Lee Jones <lee.jones@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20201128224114.1033617-10-sam@ravnborg.org

+6 -28
+6 -28
drivers/video/fbdev/sis/init.c
··· 2648 2648 SiS_SetCRT1ModeRegs(struct SiS_Private *SiS_Pr, unsigned short ModeNo, 2649 2649 unsigned short ModeIdIndex, unsigned short RRTI) 2650 2650 { 2651 - unsigned short data, infoflag = 0, modeflag, resindex; 2651 + unsigned short data, infoflag = 0, modeflag; 2652 2652 #ifdef CONFIG_FB_SIS_315 2653 2653 unsigned char *ROMAddr = SiS_Pr->VirtualRomBase; 2654 2654 unsigned short data2, data3; ··· 2659 2659 if(SiS_Pr->UseCustomMode) { 2660 2660 infoflag = SiS_Pr->CInfoFlag; 2661 2661 } else { 2662 - resindex = SiS_GetResInfo(SiS_Pr, ModeNo, ModeIdIndex); 2662 + SiS_GetResInfo(SiS_Pr, ModeNo, ModeIdIndex); 2663 2663 if(ModeNo > 0x13) { 2664 2664 infoflag = SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag; 2665 2665 } ··· 3538 3538 struct fb_var_screeninfo *var, bool writeres 3539 3539 ) 3540 3540 { 3541 - unsigned short HRE, HBE, HRS, HBS, HDE, HT; 3542 - unsigned short VRE, VBE, VRS, VBS, VDE, VT; 3543 - unsigned char sr_data, cr_data, cr_data2; 3544 - int A, B, C, D, E, F, temp; 3541 + unsigned short HRE, HBE, HRS, HDE; 3542 + unsigned short VRE, VBE, VRS, VDE; 3543 + unsigned char sr_data, cr_data; 3544 + int B, C, D, E, F, temp; 3545 3545 3546 3546 sr_data = crdata[14]; 3547 - 3548 - /* Horizontal total */ 3549 - HT = crdata[0] | ((unsigned short)(sr_data & 0x03) << 8); 3550 - A = HT + 5; 3551 3547 3552 3548 /* Horizontal display enable end */ 3553 3549 HDE = crdata[1] | ((unsigned short)(sr_data & 0x0C) << 6); ··· 3552 3556 /* Horizontal retrace (=sync) start */ 3553 3557 HRS = crdata[4] | ((unsigned short)(sr_data & 0xC0) << 2); 3554 3558 F = HRS - E - 3; 3555 - 3556 - /* Horizontal blank start */ 3557 - HBS = crdata[2] | ((unsigned short)(sr_data & 0x30) << 4); 3558 3559 3559 3560 sr_data = crdata[15]; 3560 3561 cr_data = crdata[5]; ··· 3581 3588 sr_data = crdata[13]; 3582 3589 cr_data = crdata[7]; 3583 3590 3584 - /* Vertical total */ 3585 - VT = crdata[6] | 3586 - ((unsigned short)(cr_data & 0x01) << 8) | 3587 - ((unsigned short)(cr_data & 0x20) << 4) | 3588 - ((unsigned short)(sr_data & 0x01) << 10); 3589 - A = VT + 2; 3590 - 3591 3591 /* Vertical display enable end */ 3592 3592 VDE = crdata[10] | 3593 3593 ((unsigned short)(cr_data & 0x02) << 7) | ··· 3594 3608 ((unsigned short)(cr_data & 0x80) << 2) | 3595 3609 ((unsigned short)(sr_data & 0x08) << 7); 3596 3610 F = VRS + 1 - E; 3597 - 3598 - cr_data2 = (crdata[16] & 0x01) << 5; 3599 - 3600 - /* Vertical blank start */ 3601 - VBS = crdata[11] | 3602 - ((unsigned short)(cr_data & 0x08) << 5) | 3603 - ((unsigned short)(cr_data2 & 0x20) << 4) | 3604 - ((unsigned short)(sr_data & 0x04) << 8); 3605 3611 3606 3612 /* Vertical blank end */ 3607 3613 VBE = crdata[12] | ((unsigned short)(sr_data & 0x10) << 4);