[<prev] [next>] [day] [month] [year] [list]
Message-ID: <5a11ad09-5508-933c-f044-6a236bf00557@redhat.com>
Date: Mon, 14 Jul 2025 18:17:15 +0200 (CEST)
From: Mikulas Patocka <mpatocka@...hat.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Guanghui Feng <guanghuifeng@...ux.alibaba.com>
cc: linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org
Subject: [PATCH] tty: omit need_resched() before cond_resched()
There's no need to call need_resched() because cond_resched() will do
nothing if need_resched() returns false.
Signed-off-by: Mikulas Patocka <mpatocka@...hat.com>
---
drivers/tty/tty_buffer.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Index: linux-2.6/drivers/tty/tty_buffer.c
===================================================================
--- linux-2.6.orig/drivers/tty/tty_buffer.c 2024-03-30 20:07:03.000000000 +0100
+++ linux-2.6/drivers/tty/tty_buffer.c 2025-07-14 18:06:00.000000000 +0200
@@ -499,8 +499,7 @@ static void flush_to_ldisc(struct work_s
if (!rcvd)
break;
- if (need_resched())
- cond_resched();
+ cond_resched();
}
mutex_unlock(&buf->lock);
Powered by blists - more mailing lists