From patchwork Fri Apr 7 19:24:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li kunyu X-Patchwork-Id: 80042 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp737873vqo; Wed, 5 Apr 2023 20:09:45 -0700 (PDT) X-Google-Smtp-Source: AKy350bIvz0Tj4CRInizOVRYPAAaA1HPkQ4i/Nd0EQgq7xUS4CSNDYQBilHGZ6H7GP0BQBul2Ovp X-Received: by 2002:a17:90b:4d90:b0:240:95a7:be70 with SMTP id oj16-20020a17090b4d9000b0024095a7be70mr9029130pjb.19.1680750585091; Wed, 05 Apr 2023 20:09:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680750585; cv=none; d=google.com; s=arc-20160816; b=dfm/bVyXP5+hNlHYpIkTjvaObVJwZuFFBvLPnM8wVyN15XcGtTByntQnFERffz3PST MNSxDUethbgAeNlETkC0MR2DPQtFNWtrU5Wlr5+TLIRum1i6SH022CeXkTMZyRYfMPUL 9xx4HVan1IGlpH5wAl/CAPNmcNgNuPZ8xPUGy1mVRj2dqUDhqFfueG/jW7YcJF+O1gB8 ZsLkuKKjwKUf2kn/aIetRyY+dYBInqIqKPlPJKmW9s0YyzvjSA89ZSw8jakXqkj4kgmf gL2f0NwoDtIqfZmaYsI24bgKtCX2JLMtOqKr2+z5fAHd0vM9NOFtgczQvDsjU1ZG3KVv ImOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=F9eeEPaasENmKta7943hypntcmx/vRZ9OKf4/sGQcb4=; b=bVYaMeU7MUeN75rJn+eKIhA0Pz9CZVapxHRaAXPaPrRsgkplKJRN+LS9f4FiWx81tR 2OEcaSEnyx9dheUfcimUp5iBo7kBuJAYnoOVO7PXV8Bflg21xXgFaAiVUTkLrYj5JJij iyrv7b7VeulC9Pf2nuSlTkPC84ixe+l/rJukVloMGnEck+pwy2PhkqSDhZgmEtth/q5G 3V8IxmH0RLfeLRHIL+AbohcjbIxLsofhYrFPhqe4/M0f8kN3MwgYb9NceCYIY/JC3M2h LhTRpsPkS6LhiNOW2mHHv81IwM5QwyheehQWtcGHLMsABauXoz8+9R6DeEEUvUt3fQ7z LTVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d14-20020a63f24e000000b004fbf520c66csi208320pgk.254.2023.04.05.20.09.30; Wed, 05 Apr 2023 20:09:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235075AbjDFC72 (ORCPT + 99 others); Wed, 5 Apr 2023 22:59:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234327AbjDFC7Z (ORCPT ); Wed, 5 Apr 2023 22:59:25 -0400 X-Greylist: delayed 357 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 05 Apr 2023 19:59:24 PDT Received: from mail.nfschina.com (unknown [42.101.60.222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C27125BA9 for ; Wed, 5 Apr 2023 19:59:24 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 7E1801A00B0A; Thu, 6 Apr 2023 10:53:39 +0800 (CST) X-Virus-Scanned: amavisd-new at nfschina.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (localhost.localdomain [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v_UpTTwXU7gC; Thu, 6 Apr 2023 10:53:38 +0800 (CST) Received: from localhost.localdomain (unknown [219.141.250.2]) (Authenticated sender: kunyu@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 827B81A00877; Thu, 6 Apr 2023 10:53:38 +0800 (CST) 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: rt: Simplify pick_task_rt() Date: Sat, 8 Apr 2023 03:24:35 +0800 Message-Id: <20230407192435.3390-1-kunyu@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=2.5 required=5.0 tests=DATE_IN_FUTURE_24_48,RDNS_NONE, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762394725249398965?= X-GMAIL-MSGID: =?utf-8?q?1762394725249398965?= Remove useless intermediate variable "p" and its initialization. Directly return the next RT scheduling task obtained from _pick_next_task_rt(). Signed-off-by: Li kunyu --- kernel/sched/rt.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index e9b1c08c20a7..71c930fafac5 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1799,14 +1799,10 @@ static struct task_struct *_pick_next_task_rt(struct rq *rq) static struct task_struct *pick_task_rt(struct rq *rq) { - struct task_struct *p; - if (!sched_rt_runnable(rq)) return NULL; - p = _pick_next_task_rt(rq); - - return p; + return _pick_next_task_rt(rq); } static struct task_struct *pick_next_task_rt(struct rq *rq)