linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] video: fbdev: sis: init301.c:  Cleaning up a potential division by zero
@ 2014-07-02 22:08 Rickard Strandqvist
  2014-07-02 22:08 ` Rickard Strandqvist
  0 siblings, 1 reply; 2+ messages in thread
From: Rickard Strandqvist @ 2014-07-02 22:08 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Jingoo Han, Laurent Pinchart, Rob Clark,
	linux-fbdev, linux-kernel

Guess these ifdef will always be set, but still feel that 1 is a better starting value other than 0 in this case.

This was found using a static code analysis program called cppcheck

Rickard Strandqvist (1):
  video: fbdev: sis: init301.c:  Cleaning up a potential division by zero

 drivers/video/fbdev/sis/init301.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] video: fbdev: sis: init301.c:  Cleaning up a potential division by zero
  2014-07-02 22:08 [PATCH] video: fbdev: sis: init301.c: Cleaning up a potential division by zero Rickard Strandqvist
@ 2014-07-02 22:08 ` Rickard Strandqvist
  0 siblings, 0 replies; 2+ messages in thread
From: Rickard Strandqvist @ 2014-07-02 22:08 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Jingoo Han, Laurent Pinchart, Rob Clark,
	linux-fbdev, linux-kernel

Cleaning up a potential division by zero.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/sis/init301.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/sis/init301.c b/drivers/video/fbdev/sis/init301.c
index a89e3ca..730be06 100644
--- a/drivers/video/fbdev/sis/init301.c
+++ b/drivers/video/fbdev/sis/init301.c
@@ -5351,7 +5351,7 @@ SiS_SetGroup1_LVDS(struct SiS_Private *SiS_Pr, unsigned short ModeNo, unsigned s
 {
   unsigned short modeflag, resinfo = 0;
   unsigned short push2, tempax, tempbx, tempcx, temp;
-  unsigned int   tempeax = 0, tempebx, tempecx, tempvcfact = 0;
+  unsigned int   tempeax = 0, tempebx, tempecx, tempvcfact = 1;
   bool islvds = false, issis  = false, chkdclkfirst = false;
 #ifdef CONFIG_FB_SIS_300
   unsigned short crt2crtc = 0;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-02 22:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-02 22:08 [PATCH] video: fbdev: sis: init301.c: Cleaning up a potential division by zero Rickard Strandqvist
2014-07-02 22:08 ` Rickard Strandqvist

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).