[PATCH v2] drm/mgag200: don't use uninitialized variables in mga_g200se_set_plls()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I can only guess that instead of testm/testn (which are either
uninitialized or have pre-determined values at the end of the preceding
loops) n and m were meant to be used by commit e829d7ef9f
("drm/mgag200: Add support for a new rev of G200e"). In any event the
compiler is right in warning that testm/testn are possibly uninitalized
at this point, i.e. some change is needed no matter what.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Mathieu Larouche <mathieu.larouche@xxxxxxxxxx>
---
v2: As pointed out by Mathieu, 1 needs to be added to both m and n when
    consuming them.
---
 drivers/gpu/drm/mgag200/mgag200_mode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 4.3-rc6/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ 4.3-rc6-mgag200-uninit/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -194,7 +194,7 @@ static int mga_g200se_set_plls(struct mg
 			}
 		}
 
-		fvv = pllreffreq * testn / testm;
+		fvv = pllreffreq * (n + 1) / (m + 1);
 		fvv = (fvv - 800000) / 50000;
 
 		if (fvv > 15)



_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux