linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mikulas Patocka <mpatocka@redhat.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Jiri Slaby <jirislaby@kernel.org>,
	 Guanghui Feng <guanghuifeng@linux.alibaba.com>
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: [PATCH] tty: omit need_resched() before cond_resched()
Date: Mon, 14 Jul 2025 18:17:15 +0200 (CEST)	[thread overview]
Message-ID: <5a11ad09-5508-933c-f044-6a236bf00557@redhat.com> (raw)

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>

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


                 reply	other threads:[~2025-07-14 16:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5a11ad09-5508-933c-f044-6a236bf00557@redhat.com \
    --to=mpatocka@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=guanghuifeng@linux.alibaba.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).