mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] trivial fix for warning in kernel/power/console.c
@ 2004-10-07 14:04 Ian Campbell
  2004-10-07 23:08 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Campbell @ 2004-10-07 14:04 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, trivial

Hi,

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

Signed-off-by: Ian Campbell <icampbell@arcom.com>

Index: 2.6-bk/kernel/power/console.c
===================================================================
--- 2.6-bk.orig/kernel/power/console.c	2004-10-07 14:47:25.764724497 +0100
+++ 2.6-bk/kernel/power/console.c	2004-10-07 14:47:54.241016791 +0100
@@ -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)
 {


-- 
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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] trivial fix for warning in kernel/power/console.c
  2004-10-07 14:04 [PATCH] trivial fix for warning in kernel/power/console.c Ian Campbell
@ 2004-10-07 23:08 ` Andrew Morton
  2004-10-08  8:07   ` Ian Campbell
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2004-10-07 23:08 UTC (permalink / raw)
  To: Ian Campbell
  Cc: torvalds, linux-kernel, trivial, Patrick Mochel, Pavel Machek

Ian Campbell <icampbell@arcom.com> wrote:
>
> orig_fgconsole and orig_kmsg are only used in kernel/power/console.c if 
> SUSPEND_CONSOLE is defined.
> 
> Signed-off-by: Ian Campbell <icampbell@arcom.com>
> 
> Index: 2.6-bk/kernel/power/console.c
> ===================================================================
> --- 2.6-bk.orig/kernel/power/console.c	2004-10-07 14:47:25.764724497 +0100
> +++ 2.6-bk/kernel/power/console.c	2004-10-07 14:47:54.241016791 +0100
> @@ -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.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] trivial fix for warning in kernel/power/console.c
  2004-10-07 23:08 ` Andrew Morton
@ 2004-10-08  8:07   ` Ian Campbell
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2004-10-08  8:07 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linus Torvalds, linux-kernel, trivial, Patrick Mochel, Pavel Machek

> 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.

Signed-off-by: Ian Campbell <icampbell@arcom.com>

Index: 2.6-bk/kernel/power/console.c
===================================================================
--- 2.6-bk.orig/kernel/power/console.c	2004-10-07 14:47:25.000000000 +0100
+++ 2.6-bk/kernel/power/console.c	2004-10-08 08:56:28.750936142 +0100
@@ -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;
 }

-- 
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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-10-08  8:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-07 14:04 [PATCH] trivial fix for warning in kernel/power/console.c Ian Campbell
2004-10-07 23:08 ` Andrew Morton
2004-10-08  8:07   ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome