lkml.org 
[lkml]   [2017]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] printk: modify console_unlock with printk-safe macros
Date
From: pierre Kuo <vichy.kuo@gmail.com>

In commit de6fcbdb68b2 ("printk: convert the rest to printk-safe"), we
create 4 helper macros to make printk-safe usage easier.
Here we modify some part of console_unlock with above marcros.

Signed-off-by: Pierre Kuo <vichy.kuo@gmail.com>
---
kernel/printk/printk.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index fc47863..21557cc 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2194,8 +2194,7 @@ void console_unlock(void)
size_t ext_len = 0;
size_t len;

- printk_safe_enter_irqsave(flags);
- raw_spin_lock(&logbuf_lock);
+ logbuf_lock_irqsave(flags);
if (seen_seq != log_next_seq) {
wake_klogd = true;
seen_seq = log_next_seq;
@@ -2267,8 +2266,7 @@ void console_unlock(void)
*/
raw_spin_lock(&logbuf_lock);
retry = console_seq != log_next_seq;
- raw_spin_unlock(&logbuf_lock);
- printk_safe_exit_irqrestore(flags);
+ logbuf_unlock_irqrestore(flags);

if (retry && console_trylock())
goto again;
--
1.7.9.5
\
 
 \ /
  Last update: 2017-07-15 12:37    [W:0.040 / U:0.272 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site