linux-4.7-rc2/drivers/video/fbdev/sis/init.c: 2* bad if tests ?

From: David Binderman <hidden>
Date: 2016-06-07 15:38:00
Also in: lkml

Hello there,

1.

linux-4.7-rc2/drivers/video/fbdev/sis/init.c:358]: (style) Redundant
condition: If 'LCDwidth >= 800', the comparison 'LCDwidth >= 600' is
always true.

Source code is

       if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 800) && (LCDwidth >= 600)))

Maybe better code

       if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 800) && (LCDheight >= 600)))

2.

linux-4.7-rc2/drivers/video/fbdev/sis/init.c:363]: (style) Redundant
condition: If 'LCDwidth >= 1024', the comparison 'LCDwidth >= 768' is
always true.

Source code is

        if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 1024) &&
(LCDwidth >= 768))) {

Duplicate.

Also in the same file:


[drivers/video/fbdev/sis/init.c:2663]: (style) Variable 'resindex' is
assigned a value that is never used.
[drivers/video/fbdev/sis/init.c:3562]: (style) Variable 'HBS' is
assigned a value that is never used.
[drivers/video/fbdev/sis/init.c:3616]: (style) Variable 'VBS' is
assigned a value that is never used.
[drivers/video/fbdev/sis/init.c:3597]: (style) Variable 'A' is
assigned a value that is never used.

Suggest either use these variables in some way, or delete them.

Regards

David Binderman
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help