Skip to contentSkip to conversation

trivial fix for warning in kernel/power/console.c

PATCH In review Ian Campbell 2 participants 3 messages Oct 7, 2004 – Oct 8, 2004

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

PATCH 1/1 trivial fix for warning in kernel/power/console.c

Hi,

orig_fgconsole and orig_kmsg are only used in kernel/power/console.c if SUSPEND_CONSOLE is defined.

kernel/power/console.c +2 -0
Index: 2.6-bk/kernel/power/console.c
===================================================================
@@ -11,7 +11,9 @@
 
 static int new_loglevel = 10;
 static int orig_loglevel;
+#ifdef SUSPEND_CONSOLE
 static int orig_fgconsole, orig_kmsg;
+#endif
 
 int pm_prepare_console(void)
 {
Signature · 4 lines
Ian Campbell, Senior Design Engineer
                                        Web: http://www.arcom.com
Arcom, Clifton Road, 			Direct: +44 (0)1223 403 465
Cambridge CB1 7EA, United Kingdom	Phone:  +44 (0)1223 411 200
#1 lore raw
Quoted 11 lines · Ian Campbell

orig_fgconsole and orig_kmsg are only used in kernel/power/console.c if SUSPEND_CONSOLE is defined.

Index: 2.6-bk/kernel/power/console.c
===================================================================

kernel/power/console.c line 16

Quoted 6 lines
kernel/power/console.c +2 -0
@@ -11,7 +11,9 @@
 
 static int new_loglevel = 10;
 static int orig_loglevel;
+#ifdef SUSPEND_CONSOLE
 static int orig_fgconsole, orig_kmsg;
+#endif

Not only that, orig_kmsg is assigned to but never read from.

#2 lore raw
Quoted 1 line

Not only that, orig_kmsg is assigned to but never read from.

I decided to restore it rather that dump it, so how about:

Fix warnings in kernel/power/console.c by only declaring orig_fgconsole and orig_kmsg when required by SUSPEND_CONSOLE. Restore kmsg_redirect on resume.

kernel/power/console.c +3 -0
Index: 2.6-bk/kernel/power/console.c
===================================================================
@@ -11,7 +11,9 @@
 
 static int new_loglevel = 10;
 static int orig_loglevel;
+#ifdef SUSPEND_CONSOLE
 static int orig_fgconsole, orig_kmsg;
+#endif
 
 int pm_prepare_console(void)
 {
@@ -50,6 +52,7 @@
 	acquire_console_sem();
 	set_console(orig_fgconsole);
 	release_console_sem();
+	kmsg_redirect = orig_kmsg;
 #endif
 	return;
 }
Signature · 10 lines
Ian Campbell, Senior Design Engineer
                                        Web: http://www.arcom.com
Arcom, Clifton Road, 			Direct: +44 (0)1223 403 465
Cambridge CB1 7EA, United Kingdom	Phone:  +44 (0)1223 411 200


_____________________________________________________________________
The message in this transmission is sent in confidence for the attention of the addressee only and should not be disclosed to any other party. Unauthorised recipients are requested to preserve this confidentiality. Please advise the sender if the addressee is not resident at the receiving end.  Email to and from Arcom is automatically monitored for operational and lawful business reasons.

This message has been virus scanned by MessageLabs.