From patchwork Tue Oct 20 15:55:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 7448521 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 64CACBEEA4 for ; Tue, 20 Oct 2015 15:55:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9628C203A1 for ; Tue, 20 Oct 2015 15:55:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6F10620842 for ; Tue, 20 Oct 2015 15:55:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8A9666EC6F; Tue, 20 Oct 2015 08:55:42 -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 13A586EC6F for ; Tue, 20 Oct 2015 08:55:41 -0700 (PDT) Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Tue, 20 Oct 2015 09:55:40 -0600 Message-Id: <5626801902000078000AD005@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.0.1 Date: Tue, 20 Oct 2015 09:55:37 -0600 From: "Jan Beulich" To: , "Mathieu Larouche" Subject: [PATCH v2] drm/mgag200: don't use uninitialized variables in mga_g200se_set_plls() References: <5624E21E02000078000AC48B@prv-mh.provo.novell.com> <562653EA.1030009@matrox.com> <5626733102000078000ACF6F@prv-mh.provo.novell.com> <562659C6.4050204@matrox.com> In-Reply-To: <562659C6.4050204@matrox.com> Mime-Version: 1.0 Content-Disposition: inline Cc: 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 --- 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)