* [PATCH] kernel/watchdog: Initialize 'result'
@ 2010-07-05 8:00 ` Kulikov Vasiliy
0 siblings, 0 replies; 5+ messages in thread
From: Kulikov Vasiliy @ 2010-07-05 8:00 UTC (permalink / raw)
To: Kernel Janitors
Cc: Frederic Weisbecker, Don Zickus, Ingo Molnar, linux-kernel
Variable on the stack is not initialized to zero, do it explicitly.
This patch silences a compiler warning:
kernel/watchdog.c:463: warning: ‘result’ may be used uninitialized in this function
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
kernel/watchdog.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 91b0b26..613bc1f 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -460,7 +460,7 @@ static void watchdog_disable(int cpu)
static void watchdog_enable_all_cpus(void)
{
int cpu;
- int result;
+ int result = 0;
for_each_online_cpu(cpu)
result += watchdog_enable(cpu);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] kernel/watchdog: Initialize 'result'
@ 2010-07-05 8:00 ` Kulikov Vasiliy
0 siblings, 0 replies; 5+ messages in thread
From: Kulikov Vasiliy @ 2010-07-05 8:00 UTC (permalink / raw)
To: Kernel Janitors
Cc: Frederic Weisbecker, Don Zickus, Ingo Molnar, linux-kernel
Variable on the stack is not initialized to zero, do it explicitly.
This patch silences a compiler warning:
kernel/watchdog.c:463: warning: ‘result’ may be used uninitialized in this function
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
kernel/watchdog.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 91b0b26..613bc1f 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -460,7 +460,7 @@ static void watchdog_disable(int cpu)
static void watchdog_enable_all_cpus(void)
{
int cpu;
- int result;
+ int result = 0;
for_each_online_cpu(cpu)
result += watchdog_enable(cpu);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] kernel/watchdog: Initialize 'result'
2010-07-05 8:00 ` Kulikov Vasiliy
@ 2010-07-06 13:23 ` Don Zickus
-1 siblings, 0 replies; 5+ messages in thread
From: Don Zickus @ 2010-07-06 13:23 UTC (permalink / raw)
To: Kulikov Vasiliy
Cc: Kernel Janitors, Frederic Weisbecker, Ingo Molnar, linux-kernel
On Mon, Jul 05, 2010 at 12:00:54PM +0400, Kulikov Vasiliy wrote:
> Variable on the stack is not initialized to zero, do it explicitly.
>
> This patch silences a compiler warning:
> kernel/watchdog.c:463: warning: ‘result’ may be used uninitialized in this function
Hmm, I thought I fixed that. oh well.
ACK.
>
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
> ---
> kernel/watchdog.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> index 91b0b26..613bc1f 100644
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -460,7 +460,7 @@ static void watchdog_disable(int cpu)
> static void watchdog_enable_all_cpus(void)
> {
> int cpu;
> - int result;
> + int result = 0;
>
> for_each_online_cpu(cpu)
> result += watchdog_enable(cpu);
> --
> 1.7.0.4
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kernel/watchdog: Initialize 'result'
@ 2010-07-06 13:23 ` Don Zickus
0 siblings, 0 replies; 5+ messages in thread
From: Don Zickus @ 2010-07-06 13:23 UTC (permalink / raw)
To: Kulikov Vasiliy
Cc: Kernel Janitors, Frederic Weisbecker, Ingo Molnar, linux-kernel
On Mon, Jul 05, 2010 at 12:00:54PM +0400, Kulikov Vasiliy wrote:
> Variable on the stack is not initialized to zero, do it explicitly.
>
> This patch silences a compiler warning:
> kernel/watchdog.c:463: warning: ‘result’ may be used uninitialized in this function
Hmm, I thought I fixed that. oh well.
ACK.
>
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
> ---
> kernel/watchdog.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/watchdog.c b/kernel/watchdog.c
> index 91b0b26..613bc1f 100644
> --- a/kernel/watchdog.c
> +++ b/kernel/watchdog.c
> @@ -460,7 +460,7 @@ static void watchdog_disable(int cpu)
> static void watchdog_enable_all_cpus(void)
> {
> int cpu;
> - int result;
> + int result = 0;
>
> for_each_online_cpu(cpu)
> result += watchdog_enable(cpu);
> --
> 1.7.0.4
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [tip:perf/nmi] kernel/watchdog: Initialize 'result'
2010-07-05 8:00 ` Kulikov Vasiliy
(?)
(?)
@ 2010-07-07 8:03 ` tip-bot for Kulikov Vasiliy
-1 siblings, 0 replies; 5+ messages in thread
From: tip-bot for Kulikov Vasiliy @ 2010-07-07 8:03 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, paulus, acme, hpa, mingo, a.p.zijlstra, efault,
fweisbec, rostedt, tglx, mingo, segooon, dzickus
Commit-ID: eb703f98191a505f78d0066712ad67d5dedc4c90
Gitweb: http://git.kernel.org/tip/eb703f98191a505f78d0066712ad67d5dedc4c90
Author: Kulikov Vasiliy <segooon@gmail.com>
AuthorDate: Mon, 5 Jul 2010 12:00:54 +0400
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 7 Jul 2010 08:46:42 +0200
kernel/watchdog: Initialize 'result'
Variable on the stack is not initialized to zero, do it
explicitly.
This bug was found by a compiler warning:
kernel/watchdog.c:463: warning: 'result' may be used uninitialized in this function
Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Acked-by: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <1278316854-28442-1-git-send-email-segooon@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/watchdog.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 91b0b26..613bc1f 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -460,7 +460,7 @@ static void watchdog_disable(int cpu)
static void watchdog_enable_all_cpus(void)
{
int cpu;
- int result;
+ int result = 0;
for_each_online_cpu(cpu)
result += watchdog_enable(cpu);
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-07-07 8:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-05 8:00 [PATCH] kernel/watchdog: Initialize 'result' Kulikov Vasiliy
2010-07-05 8:00 ` Kulikov Vasiliy
2010-07-06 13:23 ` Don Zickus
2010-07-06 13:23 ` Don Zickus
2010-07-07 8:03 ` [tip:perf/nmi] " tip-bot for Kulikov Vasiliy
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.