Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1487464rwl; Wed, 5 Apr 2023 18:44:46 -0700 (PDT) X-Google-Smtp-Source: AKy350bU/VbbbqslZKLFkvxzJ6f7l0jV8HTQfsUjbQtNec/fe6kW6bBDWz/wlkcQx3XgSpYC5TqD X-Received: by 2002:a17:906:9441:b0:92b:7e6a:bca0 with SMTP id z1-20020a170906944100b0092b7e6abca0mr5162282ejx.14.1680745486148; Wed, 05 Apr 2023 18:44:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680745486; cv=none; d=google.com; s=arc-20160816; b=ucT49NllX3a0BDJBvyb2g4mKRxyCTZyINyNQLMB9rGnVEtC2EJZgWSXSCqsyZIpIOt v4zZslfLDc1b/ytMLD6Ou+E2o3sXZ3aICWiYZMe/8Nuj+oo1VHVIaQxqnRvlMEE31WgI CPi4RMtl08dP5WBLj3+u3EF5iN73ucz7nTC0FnUfmD0al24GMHiDheljADVAA6Tj00pc X2gKSxaFkx1BQlrwN4yUwuQnfsU8442wfSdSXvReOYoPmQzlnNCBClGY2f8qnGEtJm73 W2Hds9u9ixKdUsYEJVI/yCpSDnzrlyUfpVC5IONVc7h2S3vS4Bv7nzNoV2d60h6S26gg 6B6w== 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=u/2I10kJiW4PUO5z+A3YZlSKqnnseW/4bRkdOTObfX4=; b=MtIBdWAE2niOGXqmFfzu6oYKHldaVOOTOzzKWex/g7teUfkCsSUBTt94kmFZlLNWGE pPrm57LJtMrMqR/aqUpQUgFweMFYYQTeKeUMhG+nmEP5F7ys9CSeXnTpfUkrJ2WaxqZP ra92Tzqi1ziUfssHCZ3smJaDmpNirD0/r0pHMJvzK/sMUJvYX8mZiaXm+xUjyOe31Wl+ arudi3lFr6/JoCALIm/A/nHx9C40WOBJKx/WDvLFElXraJWQ32kbo5kTeS2Ax5dNaj8v qUW/81VNEFW5auFpW4Us80gfsz0a1tSxWSsEBXvjcf7sJNuEnEUxOIHp5OvgCB5fzxDs r+wQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l23-20020a170906a41700b009481d36b4acsi184217ejz.675.2023.04.05.18.44.21; Wed, 05 Apr 2023 18:44:46 -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 S234615AbjDFBin (ORCPT + 99 others); Wed, 5 Apr 2023 21:38:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234609AbjDFBil (ORCPT ); Wed, 5 Apr 2023 21:38:41 -0400 Received: from mail.nfschina.com (unknown [42.101.60.222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3383D6A45 for ; Wed, 5 Apr 2023 18:38:38 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 16A321A00B04; Thu, 6 Apr 2023 09:38:51 +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 eVFBE7vZW73S; Thu, 6 Apr 2023 09:38:50 +0800 (CST) Received: from localhost.localdomain (unknown [219.141.250.2]) (Authenticated sender: zeming@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 083B31A00B02; Thu, 6 Apr 2023 09:38:50 +0800 (CST) From: Li zeming 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 zeming Subject: [PATCH v2] sched: rt: Simplify pick_next_rt_entity() Date: Sat, 8 Apr 2023 02:09:52 +0800 Message-Id: <20230407180952.2757-1-zeming@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 Remove useless intermediate variable "next" and its initialization. Directly return the next RT scheduling entity obtained from list_entry(). Signed-off-by: Li zeming Reviewed-by: Tim Chen --- v2: Simplify title and descriptive information. kernel/sched/rt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 0a11f44adee5..e9b1c08c20a7 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1769,7 +1769,6 @@ static inline void set_next_task_rt(struct rq *rq, struct task_struct *p, bool f static struct sched_rt_entity *pick_next_rt_entity(struct rt_rq *rt_rq) { struct rt_prio_array *array = &rt_rq->active; - struct sched_rt_entity *next = NULL; struct list_head *queue; int idx; @@ -1779,9 +1778,8 @@ static struct sched_rt_entity *pick_next_rt_entity(struct rt_rq *rt_rq) queue = array->queue + idx; if (SCHED_WARN_ON(list_empty(queue))) return NULL; - next = list_entry(queue->next, struct sched_rt_entity, run_list); - return next; + return list_entry(queue->next, struct sched_rt_entity, run_list); } static struct task_struct *_pick_next_task_rt(struct rq *rq) -- 2.18.2