public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: H Hartley Sweeten <hartleys@visionengravers.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: <gregkh@suse.de>, <akpm@linux-foundation.org>, <art@ified.ca>,
	<arnd@arndb.de>, <jslaby@suse.cz>
Subject: [PATCH] vt_ioctl.c: fix compile error with pm_set_vt_switch()
Date: Fri, 2 Sep 2011 14:02:42 -0700	[thread overview]
Message-ID: <201109021402.42503.hartleys@visionengravers.com> (raw)

When CONFIG_PM_SLEEP, CONFIG_VT, and CONFIG_VT_CONSOLE are not enabled
the function pm_set_vt_switch() is defined as an inline in linux/suspend.h. This causes
a compile error if CONFIG_VT is enabled.

drivers/tty/vt/vt_ioctl.c:1794: error: redefinition of 'pm_set_vt_switch'
include/linux/suspend.h:17: error: previous definition of 'pm_set_vt_switch' was here

Fix this with an #if defined guard around the function in vt_ioctl.c.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arthur Taylor <art@ified.ca>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Jiri Slaby <jslaby@suse.cz>

---

diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
index 5e096f4..7bb1b4d 100644
--- a/drivers/tty/vt/vt_ioctl.c
+++ b/drivers/tty/vt/vt_ioctl.c
@@ -1784,6 +1784,8 @@ int vt_move_to_console(unsigned int vt, int alloc)
 	return prev;
 }
 
+#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_VT_CONSOLE)
+
 /*
  * Normally during a suspend, we allocate a new console and switch to it.
  * When we resume, we switch back to the original console.  This switch
@@ -1798,3 +1800,5 @@ void pm_set_vt_switch(int do_switch)
 	console_unlock();
 }
 EXPORT_SYMBOL(pm_set_vt_switch);
+
+#endif

             reply	other threads:[~2011-09-02 21:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-02 21:02 H Hartley Sweeten [this message]
2011-09-03 10:46 ` [PATCH] vt_ioctl.c: fix compile error with pm_set_vt_switch() Alan Cox
2011-09-05 14:54   ` Arnd Bergmann
2011-09-06 18:26     ` H Hartley Sweeten
2011-09-06 19:29       ` Arnd Bergmann
2011-09-06 20:23         ` H Hartley Sweeten

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201109021402.42503.hartleys@visionengravers.com \
    --to=hartleys@visionengravers.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=art@ified.ca \
    --cc=gregkh@suse.de \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox