]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tty: omit need_resched() before cond_resched()
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 14 Jul 2025 16:17:15 +0000 (18:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jul 2025 09:05:34 +0000 (11:05 +0200)
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@redhat.com>
Link: https://lore.kernel.org/r/5a11ad09-5508-933c-f044-6a236bf00557@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_buffer.c

index 79f0ff94ce00da1b180d4f01cc26acab7159fdb6..67271fc0b223b815220a9d64bece58a3cbe2018b 100644 (file)
@@ -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);