linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ttyprintk: optimize tpk_close flush code
@ 2020-11-04  6:02 Junyong Sun
  2020-11-12  7:52 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Junyong Sun @ 2020-11-04  6:02 UTC (permalink / raw)
  To: arnd, gregkh, sunjunyong; +Cc: linux-kernel

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@xiaomi.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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-11-13  2:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04  6:02 [PATCH] ttyprintk: optimize tpk_close flush code Junyong Sun
2020-11-12  7:52 ` Greg KH
2020-11-12 13:41   ` sunjunyong
2020-11-12 17:17     ` Greg KH
2020-11-13  2:38       ` sunjunyong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).