Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1416330

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

From David Binderman <linuxdev.baldrick@gmail.com>
Newsgroups linux.kernel
Subject linux-4.7-rc2/drivers/video/fbdev/sis/init.c: 2* bad if tests ?
Date 2016-06-07 17:40 +0200
Message-ID <rHrgK-4rU-33@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

linux-4.7-rc2/drivers/video/fbdev/sis/init.c: 2* bad if tests ? David Binderman <linuxdev.baldrick@gmail.com> - 2016-06-07 17:40 +0200

csiph-web