From: Mikulas Patocka Date: Mon, 14 Jul 2025 16:17:15 +0000 (+0200) Subject: tty: omit need_resched() before cond_resched() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=103f5d8c35b3d22b700f1f6d585e499b2df62df6;p=users%2Fjedix%2Flinux-maple.git 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 Link: https://lore.kernel.org/r/5a11ad09-5508-933c-f044-6a236bf00557@redhat.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c index 79f0ff94ce00..67271fc0b223 100644 --- a/drivers/tty/tty_buffer.c +++ b/drivers/tty/tty_buffer.c @@ -499,8 +499,7 @@ static void flush_to_ldisc(struct work_struct *work) if (!rcvd) break; - if (need_resched()) - cond_resched(); + cond_resched(); } mutex_unlock(&buf->lock);