[PATCH] kernel/watchdog: Initialize 'result'

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Kulikov Vasiliy
Date: Monday, July 5, 2010 - 1:00 am

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

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] kernel/watchdog: Initialize 'result', Kulikov Vasiliy, (Mon Jul 5, 1:00 am)
Re: [PATCH] kernel/watchdog: Initialize 'result', Don Zickus, (Tue Jul 6, 6:23 am)
[tip:perf/nmi] kernel/watchdog: Initialize 'result', tip-bot for Kulikov ..., (Wed Jul 7, 1:03 am)