[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1604469744-8708-1-git-send-email-sunjunyong@xiaomi.com>
Date: Wed, 4 Nov 2020 14:02:24 +0800
From: Junyong Sun <sunjy516@...il.com>
To: arnd@...db.de, gregkh@...uxfoundation.org, sunjunyong@...omi.com
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] ttyprintk: optimize tpk_close flush code
tpk_printk(NULL,0) do nothing but call tpk_flush to
flush buffer, so why don't use tpk_flush diretcly?
this is a small optimization.
Signed-off-by: Junyong Sun <sunjunyong@...omi.com>
---
drivers/char/ttyprintk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/ttyprintk.c b/drivers/char/ttyprintk.c
index 6a0059e..2ce78b3 100644
--- a/drivers/char/ttyprintk.c
+++ b/drivers/char/ttyprintk.c
@@ -104,7 +104,7 @@ static void tpk_close(struct tty_struct *tty, struct file *filp)
spin_lock_irqsave(&tpkp->spinlock, flags);
/* flush tpk_printk buffer */
- tpk_printk(NULL, 0);
+ tpk_flush();
spin_unlock_irqrestore(&tpkp->spinlock, flags);
tty_port_close(&tpkp->port, tty, filp);
--
2.7.4
Powered by blists - more mailing lists