From: Denis Mukhin <[email protected]> Simplify the code around notification of how many messages have been rate-limited.
Not a functional change. Signed-off-by: Denis Mukhin <[email protected]> --- Changes since v1: - new patch --- xen/drivers/char/console.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index 536b883d5dcf..a60a7c213555 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -1318,15 +1318,15 @@ static bool do_printk_ratelimit(unsigned int ratelimit_ms, spin_unlock(&ratelimit_lock); if ( lost ) { - char lost_str[10]; + char msg[40]; + + snprintf(msg, sizeof(msg), + "printk: %u messages suppressed\n", lost); - snprintf(lost_str, sizeof(lost_str), "%u", lost); /* console_lock may already be acquired by printk(). */ rspin_lock(&console_lock); printk_start_of_line(CONSOLE_PREFIX); - __putstr("printk: "); - __putstr(lost_str); - __putstr(" messages suppressed.\n"); + __putstr(msg); rspin_unlock(&console_lock); } local_irq_restore(flags); -- 2.52.0
