public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Peter Zijlstra <peterz@infradead.org>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	a.p.zijlstra@chello.nl, peterz@infradead.org,
	rdunlap@xenotime.net, tglx@linutronix.de, sfr@canb.auug.org.au,
	mingo@elte.hu
Subject: [tip:sched/core] printk: Make it compile with !CONFIG_PRINTK
Date: Thu, 15 Mar 2012 06:04:20 -0700	[thread overview]
Message-ID: <tip-600e145882802d6ccbfe2c4aea243d97caeb91a9@git.kernel.org> (raw)
In-Reply-To: <1331811337.18960.179.camel@twins>

Commit-ID:  600e145882802d6ccbfe2c4aea243d97caeb91a9
Gitweb:     http://git.kernel.org/tip/600e145882802d6ccbfe2c4aea243d97caeb91a9
Author:     Peter Zijlstra <peterz@infradead.org>
AuthorDate: Thu, 15 Mar 2012 12:35:37 +0100
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 15 Mar 2012 13:38:54 +0100

printk: Make it compile with !CONFIG_PRINTK

Commit 3ccf3e830615 ("printk/sched: Introduce special
printk_sched() for those awkward moments") overlooked
an #ifdef, so move code around to respect these directives.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Link: http://lkml.kernel.org/r/1331811337.18960.179.camel@twins
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/printk.c |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/kernel/printk.c b/kernel/printk.c
index 49a2ae4..b64ce71 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1222,26 +1222,6 @@ int is_console_locked(void)
 static DEFINE_PER_CPU(int, printk_pending);
 static DEFINE_PER_CPU(char [PRINTK_BUF_SIZE], printk_sched_buf);
 
-int printk_sched(const char *fmt, ...)
-{
-	unsigned long flags;
-	va_list args;
-	char *buf;
-	int r;
-
-	local_irq_save(flags);
-	buf = __get_cpu_var(printk_sched_buf);
-
-	va_start(args, fmt);
-	r = vsnprintf(buf, PRINTK_BUF_SIZE, fmt, args);
-	va_end(args);
-
-	__this_cpu_or(printk_pending, PRINTK_PENDING_SCHED);
-	local_irq_restore(flags);
-
-	return r;
-}
-
 void printk_tick(void)
 {
 	if (__this_cpu_read(printk_pending)) {
@@ -1658,6 +1638,26 @@ late_initcall(printk_late_init);
 
 #if defined CONFIG_PRINTK
 
+int printk_sched(const char *fmt, ...)
+{
+	unsigned long flags;
+	va_list args;
+	char *buf;
+	int r;
+
+	local_irq_save(flags);
+	buf = __get_cpu_var(printk_sched_buf);
+
+	va_start(args, fmt);
+	r = vsnprintf(buf, PRINTK_BUF_SIZE, fmt, args);
+	va_end(args);
+
+	__this_cpu_or(printk_pending, PRINTK_PENDING_SCHED);
+	local_irq_restore(flags);
+
+	return r;
+}
+
 /*
  * printk rate limiting, lifted from the networking subsystem.
  *

  reply	other threads:[~2012-03-15 13:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-14  7:19 linux-next: Tree for Mar 14 Stephen Rothwell
2012-03-14 15:56 ` linux-next: Tree for Mar 14 (printk) Randy Dunlap
2012-03-14 20:19   ` Stephen Rothwell
2012-03-15 11:35     ` [PATCH] printk: Make it compile with !CONFIG_PRINTK Peter Zijlstra
2012-03-15 13:04       ` tip-bot for Peter Zijlstra [this message]
2012-03-15 15:44       ` Randy Dunlap
2012-03-14 17:02 ` [PATCH -next] staging: ozwpan depends on NET Randy Dunlap
2012-03-14 17:10   ` Chris Kelly

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=tip-600e145882802d6ccbfe2c4aea243d97caeb91a9@git.kernel.org \
    --to=peterz@infradead.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=rdunlap@xenotime.net \
    --cc=sfr@canb.auug.org.au \
    --cc=tglx@linutronix.de \
    /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