From nobody Sat Feb 7 18:28:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F04BCC7EE23 for ; Mon, 29 May 2023 01:40:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229580AbjE2Bky (ORCPT ); Sun, 28 May 2023 21:40:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjE2Bkw (ORCPT ); Sun, 28 May 2023 21:40:52 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 8DDABC7 for ; Sun, 28 May 2023 18:40:47 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 0946018011D6BC; Mon, 29 May 2023 09:40:25 +0800 (CST) X-MD-Sfrom: kunyu@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li kunyu To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com Cc: linux-kernel@vger.kernel.org, Li kunyu Subject: [PATCH] sched: deadline: Simplify pick_earliest_pushable_dl_task() Date: Wed, 31 May 2023 02:11:45 +0800 Message-Id: <20230530181145.2880-1-kunyu@nfschina.com> X-Mailer: git-send-email 2.18.2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Using the while statement instead of the if and goto statements is more concise and efficient. Signed-off-by: Li kunyu Reviewed-by: Mukesh Ojha --- kernel/sched/deadline.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index d823e608c7f0..b94a498f8cd9 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -2112,15 +2112,13 @@ static struct task_struct *pick_earliest_pushable_d= l_task(struct rq *rq, int cpu =20 next_node =3D rb_first_cached(&rq->dl.pushable_dl_tasks_root); =20 -next_node: - if (next_node) { + while (next_node) { p =3D __node_2_pdl(next_node); =20 if (pick_dl_task(rq, p, cpu)) return p; =20 next_node =3D rb_next(next_node); - goto next_node; } =20 return NULL; --=20 2.18.2