aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/printk
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-13 17:04:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-13 17:04:41 -0500
commit8f4385d590d4296ec38e228d17b1d002f6031dd2 (patch)
tree1be286e0a0a2ab63da0bd4f7d5d8b61ebc5bf3db /kernel/printk
parent52bb452558a426ba265a19e6eadc66cf95613014 (diff)
parent1fb8915b9876a80f43732980208b39d013f8da9d (diff)
Merge tag 'trace-seq-buf-3.19-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing fixlet from Steven Rostedt: "Remove unnecessary preempt_disable in printk()" * tag 'trace-seq-buf-3.19-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: printk: Do not disable preemption for accessing printk_func
Diffstat (limited to 'kernel/printk')
-rw-r--r--kernel/printk/printk.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index f900dc9f6822..02d6b6d28796 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -1857,10 +1857,16 @@ asmlinkage __visible int printk(const char *fmt, ...)
1857 int r; 1857 int r;
1858 1858
1859 va_start(args, fmt); 1859 va_start(args, fmt);
1860 preempt_disable(); 1860
1861 /*
1862 * If a caller overrides the per_cpu printk_func, then it needs
1863 * to disable preemption when calling printk(). Otherwise
1864 * the printk_func should be set to the default. No need to
1865 * disable preemption here.
1866 */
1861 vprintk_func = this_cpu_read(printk_func); 1867 vprintk_func = this_cpu_read(printk_func);
1862 r = vprintk_func(fmt, args); 1868 r = vprintk_func(fmt, args);
1863 preempt_enable(); 1869
1864 va_end(args); 1870 va_end(args);
1865 1871
1866 return r; 1872 return r;