Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp338664rdb; Sun, 14 Jan 2024 21:02:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IGh6/USQN13w2eG419rND6tm1J93oIy8rOY0sOHqyaVMLn7WYBfxaK7WpntqGTKdByJkw8V X-Received: by 2002:a05:6808:e8d:b0:3bb:d32d:702e with SMTP id k13-20020a0568080e8d00b003bbd32d702emr6509508oil.100.1705294963567; Sun, 14 Jan 2024 21:02:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705294963; cv=none; d=google.com; s=arc-20160816; b=e2VzuH+atHJW9EceaPwl72pJpwUaKAy/AiZnae9zeGLi/xLPv0N7ZQbfz/2de/jpyD F68nhcFLi+5oPYWAZolumWk9/Ec4A6l/N33Gp3zsq5nWJ1mH5AC4drex+mRRXJ0e2KgT 1uBz4KB6ZgCbeVvcKP/N1wwWZKNayNNzu7YkniLC4RsTpOiW4FVvSviM4hXIIqzwXLYJ p7axwpUoNnenDjGOMxVC9+zOowS7W3kpVRNjPJJhN0NWiU8lSkBTOaAjh5AzZtj9WR5r SO3haguulw/yUyNUnfSah9ZIu8ke2vQJnN8/rRRggTHJJk85ksMS+EvBj11CoNC5Q+DS 6tPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=lBx+7nx5ju12g5nsS1erkK2hTntT4wyajZt/YcVrrkg=; fh=7XK6E8opnvAFOcXA6M7iIbWsU5mUKljd4SacDmVPnss=; b=sKQ6V9776Tnlm2v51G3rV/129rdkGaaL8vNhdHLXL/M+6SDb8hrox+Fe15FIVl1vyB dy7lLz+ed9NSFdzJjRikrL9x8HOBw0ZM3P1eq4HXA/LfOGstBA1tEhaNH6duGF9lMznR NhesJcPcHhbw+3kVUIxyGQnLbA25CWku0ZUMQaI30Zdkk9LuX4Y7F3aGkNbkiyTw7xRm VWSuIxF7nWkVy17Zzd6Rv3sc/3HbCOI8rvMkPQeAqzonNmvNQWq1YK+zZj8lAfPtGTYf jffMvuFyFSjtRdxIpg6daNuSDxZKGUnhSfHSPMgBu/SuvSZiCbarY5lZL11UzIOlMA0d 9F+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-25627-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25627-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id cn8-20020a056a020a8800b005be00724141si8665429pgb.533.2024.01.14.21.02.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jan 2024 21:02:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25627-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-25627-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25627-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3EE3728172D for ; Mon, 15 Jan 2024 05:02:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA9F423BE; Mon, 15 Jan 2024 05:02:36 +0000 (UTC) Received: from out30-97.freemail.mail.aliyun.com (out30-97.freemail.mail.aliyun.com [115.124.30.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 462AD17CF for ; Mon, 15 Jan 2024 05:02:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=liusong@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0W-ZivNm_1705293980; Received: from localhost(mailfrom:liusong@linux.alibaba.com fp:SMTPD_---0W-ZivNm_1705293980) by smtp.aliyun-inc.com; Mon, 15 Jan 2024 12:46:50 +0800 From: Liu Song To: mingo@redhat.com, peterz@infradead.org Cc: linux-kernel@vger.kernel.org, liusong@linux.alibaba.com Subject: [PATCH] sched/eevdf: using leftmost improves the readability of the code Date: Mon, 15 Jan 2024 12:46:19 +0800 Message-Id: <20240115044619.34718-1-liusong@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Using 'leftmost' enhances code readability, without involving any logical changes. Signed-off-by: Liu Song --- kernel/sched/fair.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index f2bb83675e4a..4247584258ae 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -848,12 +848,12 @@ struct sched_entity *__pick_root_entity(struct cfs_rq *cfs_rq) struct sched_entity *__pick_first_entity(struct cfs_rq *cfs_rq) { - struct rb_node *left = rb_first_cached(&cfs_rq->tasks_timeline); + struct rb_node *leftmost = rb_first_cached(&cfs_rq->tasks_timeline); - if (!left) + if (!leftmost) return NULL; - return __node_2_se(left); + return __node_2_se(leftmost); } /* -- 2.19.1.6.gb485710b