Skip to contentSkip to conversation

Fix compilation warning for arch/x86/kernel/apm_32.c

PATCH RESEND In review Subrata Modak 1 participant 2 messages Jul 21, 2009 – Aug 4, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 5/6 Fix compilation warning for arch/x86/kernel/apm_32.c

The following fix was initially inspired by David Howells fix few days back:
http://lkml.org/lkml/2009/7/9/109,

However, Ingo disapproves such fixes as it's dangerous - in something as performance-uncritical. So, initialize 'err' to '0' to work around a GCC false positive warning:
http://lkml.org/lkml/2009/7/18/89,

---

arch/x86/kernel/apm_32.c +1 -1
@@ -811,7 +811,7 @@ static int apm_do_idle(void)
 	u8 ret = 0;
 	int idled = 0;
 	int polling;
-	int err;
+	int err = 0;
 
 	polling = !!(current_thread_info()->status & TS_POLLING);
 	if (polling) {

---
Regards--
Subrata

#1 lore raw

[tip:x86/urgent] x86: Work around compilation warning in arch/x86/kernel/apm_32.c

Commit-ID:  dc731fbbadf5d65c98fcd6c86472aa286c16458a
Gitweb:     http://git.kernel.org/tip/dc731fbbadf5d65c98fcd6c86472aa286c16458a
Author:     Subrata Modak <[email protected]>
AuthorDate: Tue, 21 Jul 2009 08:02:27 +0530
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 4 Aug 2009 16:34:23 +0200

x86: Work around compilation warning in arch/x86/kernel/apm_32.c

The following fix was initially inspired by David Howells fix few days back:

http://lkml.org/lkml/2009/7/9/109

However, Ingo disapproves such fixes as it's dangerous (it can hide future, relevant warnings) - in something as performance-uncritical.

So, initialize 'err' to '0' to work around a GCC false positive warning:

http://lkml.org/lkml/2009/7/18/89

Cc Sachin P Sant <[email protected]>
Cc David Howells <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Stephen Rothwell <[email protected]>

LKML-Reference: <20090721023226.31855.67236.sendpatchset@subratamodak.linux.ibm.com>

---
 arch/x86/kernel/apm_32.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/apm_32.c +1 -1
index 79302e9..442b550 100644
@@ -811,7 +811,7 @@ static int apm_do_idle(void)
 	u8 ret = 0;
 	int idled = 0;
 	int polling;
-	int err;
+	int err = 0;
 
 	polling = !!(current_thread_info()->status & TS_POLLING);
 	if (polling) {