[PATCH] tty: omit need_resched() before cond_resched()

From: Mikulas Patocka
Date: Mon Jul 14 2025 - 12:23:18 EST


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@xxxxxxxxxx>

---
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);