Messages in this thread Patch in this message | | | From | John Ogness <> | Subject | [PATCH printk v1 04/10] printk: relocate printk_delay() | Date | Tue, 3 Aug 2021 15:18:55 +0206 |
| |
Move printk_delay() "as is" further up so that it can be used by new functions in an upcoming commit.
Signed-off-by: John Ogness <john.ogness@linutronix.de> --- kernel/printk/printk.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 1b546e117f10..8bdfac4c9ee9 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -1875,6 +1875,20 @@ SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len) return do_syslog(type, buf, len, SYSLOG_FROM_READER); } +int printk_delay_msec __read_mostly; + +static inline void printk_delay(void) +{ + if (unlikely(printk_delay_msec)) { + int m = printk_delay_msec; + + while (m--) { + mdelay(1); + touch_nmi_watchdog(); + } + } +} + /* * Special console_lock variants that help to reduce the risk of soft-lockups. * They allow to pass console_lock to another printk() call using a busy wait. @@ -2129,20 +2143,6 @@ static u8 *__printk_recursion_counter(void) local_irq_restore(flags); \ } while (0) -int printk_delay_msec __read_mostly; - -static inline void printk_delay(void) -{ - if (unlikely(printk_delay_msec)) { - int m = printk_delay_msec; - - while (m--) { - mdelay(1); - touch_nmi_watchdog(); - } - } -} - static inline u32 printk_caller_id(void) { return in_task() ? task_pid_nr(current) : -- 2.20.1
| |