From: Daniel Walker <dwalker@mvista.com>
To: akpm@osdl.org
Cc: jgarzik@pobox.com, linux-kernel@vger.kernel.org
Subject: [PATCH -mm] riva CalcStateExt gcc 4.1 warning fix
Date: Tue, 9 May 2006 19:56:05 -0700 [thread overview]
Message-ID: <200605100256.k4A2u56F031749@dwalker1.mvista.com> (raw)
This could be a bug. The return from CalcVClock isn't checked
so the variables in questions could be random data ..
Fixes the following warning,
drivers/video/riva/riva_hw.c: In function 'CalcStateExt':
drivers/video/riva/riva_hw.c:1241: warning: 'p' may be used uninitialized in this function
drivers/video/riva/riva_hw.c:1241: warning: 'n' may be used uninitialized in this function
drivers/video/riva/riva_hw.c:1241: warning: 'm' may be used uninitialized in this function
drivers/video/riva/riva_hw.c:1241: warning: 'VClk' may be used uninitialized in this function
Signed-Off-By: Daniel Walker <dwalker@mvista.com>
Index: linux-2.6.16/drivers/video/riva/riva_hw.c
===================================================================
--- linux-2.6.16.orig/drivers/video/riva/riva_hw.c
+++ linux-2.6.16/drivers/video/riva/riva_hw.c
@@ -1238,7 +1238,12 @@ static void CalcStateExt
int dotClock
)
{
- int pixelDepth, VClk, m, n, p;
+ int pixelDepth;
+ int VClk = 0;
+ int m = 0;
+ int n = 0;
+ int p = 0;
+
/*
* Save mode parameters.
*/
next reply other threads:[~2006-05-10 2:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-10 2:56 Daniel Walker [this message]
2006-05-10 10:35 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200605100256.k4A2u56F031749@dwalker1.mvista.com \
--to=dwalker@mvista.com \
--cc=akpm@osdl.org \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®