* [PATCH] Fix use of uninitialized variable in drivers/video/sis/init301.c::SiS_DDC2Delay()
@ 2006-10-23 21:26 Jesper Juhl
2006-10-23 21:26 ` David Rientjes
0 siblings, 1 reply; 4+ messages in thread
From: Jesper Juhl @ 2006-10-23 21:26 UTC (permalink / raw)
To: linux-kernel; +Cc: Thomas Winischhofer, Jesper Juhl
The variable 'j' is used uninitialized in the loop. Fix by initializing it to zero.
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---
drivers/video/sis/init301.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/video/sis/init301.c b/drivers/video/sis/init301.c
index f13fadd..f65bedb 100644
--- a/drivers/video/sis/init301.c
+++ b/drivers/video/sis/init301.c
@@ -445,7 +445,8 @@ #endif
void
SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned int delaytime)
{
- unsigned int i, j;
+ unsigned int i
+ unsigned int j = 0;
for(i = 0; i < delaytime; i++) {
j += SiS_GetReg(SiS_Pr->SiS_P3c4,0x05);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix use of uninitialized variable in drivers/video/sis/init301.c::SiS_DDC2Delay()
2006-10-23 21:26 [PATCH] Fix use of uninitialized variable in drivers/video/sis/init301.c::SiS_DDC2Delay() Jesper Juhl
@ 2006-10-23 21:26 ` David Rientjes
2006-10-23 21:42 ` Jesper Juhl
0 siblings, 1 reply; 4+ messages in thread
From: David Rientjes @ 2006-10-23 21:26 UTC (permalink / raw)
To: Jesper Juhl; +Cc: linux-kernel, Thomas Winischhofer
On Mon, 23 Oct 2006, Jesper Juhl wrote:
> The variable 'j' is used uninitialized in the loop. Fix by initializing it to zero.
>
> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
> ---
>
> drivers/video/sis/init301.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/video/sis/init301.c b/drivers/video/sis/init301.c
> index f13fadd..f65bedb 100644
> --- a/drivers/video/sis/init301.c
> +++ b/drivers/video/sis/init301.c
> @@ -445,7 +445,8 @@ #endif
> void
> SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned int delaytime)
> {
> - unsigned int i, j;
> + unsigned int i
> + unsigned int j = 0;
>
> for(i = 0; i < delaytime; i++) {
> j += SiS_GetReg(SiS_Pr->SiS_P3c4,0x05);
>
>
I doubt this patch compile tested.
David
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix use of uninitialized variable in drivers/video/sis/init301.c::SiS_DDC2Delay()
2006-10-23 21:26 ` David Rientjes
@ 2006-10-23 21:42 ` Jesper Juhl
2006-10-23 22:09 ` Jesper Juhl
0 siblings, 1 reply; 4+ messages in thread
From: Jesper Juhl @ 2006-10-23 21:42 UTC (permalink / raw)
To: David Rientjes; +Cc: linux-kernel, Thomas Winischhofer
On Monday 23 October 2006 23:26, David Rientjes wrote:
> On Mon, 23 Oct 2006, Jesper Juhl wrote:
>
> > The variable 'j' is used uninitialized in the loop. Fix by initializing it to zero.
> >
[snip]
>
> I doubt this patch compile tested.
>
You are right. I hang my head in shame and admit I did not compile test this one.
Fixed patch below.
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---
drivers/video/sis/init301.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/video/sis/init301.c b/drivers/video/sis/init301.c
index f13fadd..45a5969 100644
--- a/drivers/video/sis/init301.c
+++ b/drivers/video/sis/init301.c
@@ -445,7 +445,8 @@ #endif
void
SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned int delaytime)
{
- unsigned int i, j;
+ unsigned int i;
+ unsigned int j = 0;
for(i = 0; i < delaytime; i++) {
j += SiS_GetReg(SiS_Pr->SiS_P3c4,0x05);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix use of uninitialized variable in drivers/video/sis/init301.c::SiS_DDC2Delay()
2006-10-23 21:42 ` Jesper Juhl
@ 2006-10-23 22:09 ` Jesper Juhl
0 siblings, 0 replies; 4+ messages in thread
From: Jesper Juhl @ 2006-10-23 22:09 UTC (permalink / raw)
To: David Rientjes; +Cc: linux-kernel, Thomas Winischhofer
On 23/10/06, Jesper Juhl <jesper.juhl@gmail.com> wrote:
> On Monday 23 October 2006 23:26, David Rientjes wrote:
> > On Mon, 23 Oct 2006, Jesper Juhl wrote:
> >
> > > The variable 'j' is used uninitialized in the loop. Fix by initializing it to zero.
> > >
> [snip]
> >
> > I doubt this patch compile tested.
> >
> You are right. I hang my head in shame and admit I did not compile test this one.
> Fixed patch below.
>
>
> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
> ---
>
> drivers/video/sis/init301.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/video/sis/init301.c b/drivers/video/sis/init301.c
> index f13fadd..45a5969 100644
> --- a/drivers/video/sis/init301.c
> +++ b/drivers/video/sis/init301.c
> @@ -445,7 +445,8 @@ #endif
> void
> SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned int delaytime)
> {
> - unsigned int i, j;
> + unsigned int i;
> + unsigned int j = 0;
>
> for(i = 0; i < delaytime; i++) {
> j += SiS_GetReg(SiS_Pr->SiS_P3c4,0x05);
>
Damn it, my brain seems to be non-functional tonight.
'j' is not used at all. just ignore this patch. I'll come up with
something proper some other day - right now it's obviously time for me
to get some sleep.
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-10-23 22:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-23 21:26 [PATCH] Fix use of uninitialized variable in drivers/video/sis/init301.c::SiS_DDC2Delay() Jesper Juhl
2006-10-23 21:26 ` David Rientjes
2006-10-23 21:42 ` Jesper Juhl
2006-10-23 22:09 ` Jesper Juhl
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.