From patchwork Mon Oct 19 10:29:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 7438151 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 76CA09F6E4 for ; Mon, 19 Oct 2015 15:37:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F394920791 for ; Mon, 19 Oct 2015 15:37:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B284820795 for ; Mon, 19 Oct 2015 15:37:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A596B6EA53; Mon, 19 Oct 2015 08:37:39 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from prv-mh.provo.novell.com (prv-mh.provo.novell.com [137.65.248.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id 096F96E18D for ; Mon, 19 Oct 2015 03:49:28 -0700 (PDT) Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Mon, 19 Oct 2015 04:29:23 -0600 Message-Id: <5624E21E02000078000AC48B@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.0.1 Date: Mon, 19 Oct 2015 04:29:18 -0600 From: "Jan Beulich" To: Subject: drm/mgag200: don't use uninitialized variables in mga_g200se_set_plls() Mime-Version: 1.0 Content-Disposition: inline X-Mailman-Approved-At: Mon, 19 Oct 2015 08:37:36 -0700 Cc: mathieu.larouche@matrox.com, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Mathieu Larouche --- 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 / m; fvv = (fvv - 800000) / 50000; if (fvv > 15)