#
688cf598 |
| 03-Apr-2024 |
Arnd Bergmann <arnd@arndb.de> |
fbdev: sisfb: hide unused variables
Building with W=1 shows that a couple of variables in this driver are only used in certain configurations:
drivers/video/fbdev/sis/init301.c:239:28: error: 'SiS_
fbdev: sisfb: hide unused variables
Building with W=1 shows that a couple of variables in this driver are only used in certain configurations:
drivers/video/fbdev/sis/init301.c:239:28: error: 'SiS_Part2CLVX_6' defined but not used [-Werror=unused-const-variable=] 239 | static const unsigned char SiS_Part2CLVX_6[] = { /* 1080i */ | ^~~~~~~~~~~~~~~ drivers/video/fbdev/sis/init301.c:230:28: error: 'SiS_Part2CLVX_5' defined but not used [-Werror=unused-const-variable=] 230 | static const unsigned char SiS_Part2CLVX_5[] = { /* 750p */ | ^~~~~~~~~~~~~~~ drivers/video/fbdev/sis/init301.c:211:28: error: 'SiS_Part2CLVX_4' defined but not used [-Werror=unused-const-variable=] 211 | static const unsigned char SiS_Part2CLVX_4[] = { /* PAL */ | ^~~~~~~~~~~~~~~ drivers/video/fbdev/sis/init301.c:192:28: error: 'SiS_Part2CLVX_3' defined but not used [-Werror=unused-const-variable=] 192 | static const unsigned char SiS_Part2CLVX_3[] = { /* NTSC, 525i, 525p */ | ^~~~~~~~~~~~~~~ drivers/video/fbdev/sis/init301.c:184:28: error: 'SiS_Part2CLVX_2' defined but not used [-Werror=unused-const-variable=] 184 | static const unsigned char SiS_Part2CLVX_2[] = { | ^~~~~~~~~~~~~~~ drivers/video/fbdev/sis/init301.c:176:28: error: 'SiS_Part2CLVX_1' defined but not used [-Werror=unused-const-variable=] 176 | static const unsigned char SiS_Part2CLVX_1[] = { | ^~~~~~~~~~~~~~~
This started showing up after the definitions were moved into the source file from the header, which was not flagged by the compiler. Move the definition into the appropriate #ifdef block that already exists next to them.
Fixes: 5908986ef348 ("video: fbdev: sis: avoid mismatched prototypes") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Helge Deller <deller@gmx.de>
show more ...
|
#
864eb1af |
| 08-Oct-2018 |
Nathan Chancellor <natechancellor@gmail.com> |
video: fbdev: sis: Remove unnecessary parentheses and commented code
Clang warns when multiple pairs of parentheses are used for a single conditional statement.
drivers/video/fbdev/sis/init301.c:85
video: fbdev: sis: Remove unnecessary parentheses and commented code
Clang warns when multiple pairs of parentheses are used for a single conditional statement.
drivers/video/fbdev/sis/init301.c:851:42: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* || ~~~~~~~~~~~~~~~~~~~~~~~~^~~~ drivers/video/fbdev/sis/init301.c:851:42: note: remove extraneous parentheses around the comparison to silence this warning } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* || ~ ^ ~ drivers/video/fbdev/sis/init301.c:851:42: note: use '=' to turn this equality comparison into an assignment } else if((SiS_Pr->SiS_IF_DEF_LVDS == 1) /* || ^~ = 1 warning generated.
Remove the parentheses and while we're at it, clean up the commented code, which has been here since the beginning of git history.
Link: https://github.com/ClangBuiltLinux/linux/issues/118 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Cc: Thomas Winischhofer <thomas@winischhofer.net> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
show more ...
|
#
5908986e |
| 12-Mar-2018 |
Arnd Bergmann <arnd@arndb.de> |
video: fbdev: sis: avoid mismatched prototypes
Building with LTO enabled reveals some functions whose prototypes in the header are different from the definition:
drivers/video/fbdev/sis/sis_main.h:
video: fbdev: sis: avoid mismatched prototypes
Building with LTO enabled reveals some functions whose prototypes in the header are different from the definition:
drivers/video/fbdev/sis/sis_main.h:765:0: error: type of 'SiS_SetCH70xxANDOR' does not match original declaration [-Werror=lto-type-mismatch] extern void SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg,
drivers/video/fbdev/sis/init301.c:8937:0: note: type mismatch in parameter 4 SiS_SetCH70xxANDOR(struct SiS_Private *SiS_Pr, unsigned short reg,
drivers/video/fbdev/sis/init301.c:8937:0: note: type 'short unsigned int' should match type 'unsigned char' drivers/video/fbdev/sis/init301.c:8937:0: note: 'SiS_SetCH70xxANDOR' was previously declared here
The root cause appears to be the way that header files are used in this driver, where they contain both static variable and declarations for symbols in other files.
To clean that up, I'm changing all mixed headers to only contain declarations the way we normally do in C, or contain only static variables, and move the rest to a more appropriate place. Once that is done, the headers can be included in the other files as well, and guarantee that the prototypes match.
There are a few headers that now only contain static variables, and I'm leaving those alone here as the patch is already too big. These could be trivially moved into the respective .c files.
Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Thomas Winischhofer <thomas@winischhofer.net> Cc: Nicolas Pitre <nico@linaro.org> Cc: Andi Kleen <ak@linux.intel.com> Cc: "Gustavo A. R. Silva" <gustavo@embeddedor.com>, Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
show more ...
|
#
b90b3eca |
| 12-Oct-2017 |
Colin Ian King <colin.king@canonical.com> |
video: fbdev: sis: make const array specialtv static, reduces object code size
Don't populate the const array specialtv on the stack, instead make it static. Makes the object code smaller by over 1
video: fbdev: sis: make const array specialtv static, reduces object code size
Don't populate the const array specialtv on the stack, instead make it static. Makes the object code smaller by over 1100 bytes:
Before: text data bss dec hex filename 179899 7504 0 187403 2dc0b drivers/video/fbdev/sis/init301.o
After: text data bss dec hex filename 178720 7568 0 186288 2d7b0 drivers/video/fbdev/sis/init301.o
(gcc version 7.2.0, x86_64)
Signed-off-by: Colin Ian King <colin.king@canonical.com> Cc: Thomas Winischhofer <thomas@winischhofer.net> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
show more ...
|
#
d3e329b3 |
| 04-Sep-2017 |
Gustavo A. R. Silva <gustavo@embeddedor.com> |
video: fbdev: sis: fix duplicated code for different branches
Refactor code in order to avoid identical code for different branches.
This issue was detected with the help of Coccinelle.
Addresses-
video: fbdev: sis: fix duplicated code for different branches
Refactor code in order to avoid identical code for different branches.
This issue was detected with the help of Coccinelle.
Addresses-Coverity-ID: 1226761 Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Cc: Thomas Winischhofer <thomas@winischhofer.net> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
show more ...
|
#
32ad6195 |
| 29-Feb-2016 |
Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
video: fbdev: sis: remove unused variable
The variables modeflag and resinfo were only assigned some value but were never used.
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Sign
video: fbdev: sis: remove unused variable
The variables modeflag and resinfo were only assigned some value but were never used.
Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
show more ...
|
#
a9a3cac6 |
| 23-Aug-2014 |
Julia Lawall <Julia.Lawall@lip6.fr> |
video: fbdev: sis: delete double assignment
Delete successive assignments to the same location. The second assignment is changed to update a different field, as done in other nearby code.
A simpli
video: fbdev: sis: delete double assignment
Delete successive assignments to the same location. The second assignment is changed to update a different field, as done in other nearby code.
A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/)
// <smpl> @@ expression i; @@
*i = ...; i = ...; // </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
show more ...
|
#
f7018c21 |
| 13-Feb-2014 |
Tomi Valkeinen <tomi.valkeinen@ti.com> |
video: move fbdev to drivers/video/fbdev
The drivers/video directory is a mess. It contains generic video related files, directories for backlight, console, linux logo, lots of fbdev device drivers,
video: move fbdev to drivers/video/fbdev
The drivers/video directory is a mess. It contains generic video related files, directories for backlight, console, linux logo, lots of fbdev device drivers, fbdev framework files.
Make some order into the chaos by creating drivers/video/fbdev directory, and move all fbdev related files there.
No functionality is changed, although I guess it is possible that some subtle Makefile build order related issue could be created by this patch.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Rob Clark <robdclark@gmail.com> Acked-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
show more ...
|