Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp118941lqr; Wed, 5 Jun 2024 00:14:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV9D1ZXhkY4c7LpbTTXJsUSkPOrNG+v53KsnChQWbJzMY5VnuEjEWfyRC8p9+My48XDMHp/5/T+0ZvpbTYecaL6zlHquDhgtByu7YB/GQ== X-Google-Smtp-Source: AGHT+IG4+idp4MGQm2YrLwDDOuRpbmY3sqUmTGzqY3tMv03OZrVAI4d1Z7FZw2r39BCfJv/6dcft X-Received: by 2002:a17:902:ce88:b0:1f6:ab51:22fd with SMTP id d9443c01a7336-1f6ab512a29mr5978855ad.31.1717571674312; Wed, 05 Jun 2024 00:14:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717571674; cv=pass; d=google.com; s=arc-20160816; b=pGwvl4+MRmrCUTXthjcfLYKh3gr9rZ3bNNduLruhQK9NDbl3pk/BogG1d2RppzsCsS wtI+NHXpcXwkrVd6mgEGKuz/cy3VSQG4CjIboO9XqDnU+xOk9uRT4aL4y7LSy1gSOp+m lammlA8zQEl15nBUdTeTnVetkvPV2wazjTGXabrJnXs7+hmt5WWZjVijORyZZL+jwpgj m+aXymXJXXh9wPUdeLM1idsM6kL2tJcGsLveUxJsrLB6oeJ4PQcy6VkBLElwVgPjyCUY R5One9gZ8vKNLBjY/l+wD2gYnFlwX/WCWXPBihabDzYydmbhCRxoAmJ9+gQh3yZcYHJ+ J0Gg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=/WNbPbpU/fQWtiztCW4AK9aUkRXhBMbAizMh4fqXM7c=; fh=0h44EYvEZbYUs2pnX8NKzdqtBqow1rIxMt8eYvkG8MI=; b=fsFLr00WNYjx2f019jAdnkRBBd22qUq+AOQo+/8SZ2xrVE5XIcDZ2guWM+gtqBa2FB irF1OuHawK4CJzNv6LGfGQQkdfHSxX0l0gSIALAAmr/4VGjfHwCQeEFFJ+SRXan/Qr6d y5cR1/s4+NKw0+CKhQr9b3uJl4tYlwtmtuKsRO9eOUk/ihW0383Xxr4lVQAD8MfMcHLD sXoOffxHOcZHWVN95XHMMd8bgpUym5RkeBs5O55xM5E4IucdbpiLcUHOeFY4hGBoK4Yn nuTL7L3wWKMsyn/igELeqaDC3zH9Mc0ViJt1ijI6u2rsRPFnFui/5sL7SKLD9123HGTv 8xiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-201822-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201822-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f63236c982si94876055ad.187.2024.06.05.00.14.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 00:14:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201822-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-201822-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201822-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6D153B28310 for ; Wed, 5 Jun 2024 06:54:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D84B18C327; Wed, 5 Jun 2024 06:54:35 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90D9019046E; Wed, 5 Jun 2024 06:54:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717570474; cv=none; b=djJZhVadB9ZGZvJoqKP2cWaxRSHciSfk4pMcXCwRYnNLB1dukF/nW7vduYPupxNegBKJBLSGVVv1XaKgdF44yXpGvBmHhq3ODzZHelQwd/uoIei3+m1qVYDpyBp9292PKbH9z4ZeLKmRrX3Wcth/aE88/9LwlqVyUKe7JOCSooc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717570474; c=relaxed/simple; bh=fovqmaL8GE2v0nXhtsKkRl+/v2E0D+OdwswGcKfLpcY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cF5h9zWMdMIe5B5p6DlkUY5LQyp7ghwhAwjNbN8B9PDUNDSFBARVxGWT6ZD2UCEPUc6N3+jFgbJlq1FViLwVh1BVzcUzGGGwdmtuN25ih7EAiqZGetjdjcyQtz7xIKcnZupeknB77BEFoW0HIzQAjBkq5e6im6lXkCJEdTyAYws= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3ED45DA7; Tue, 4 Jun 2024 23:54:54 -0700 (PDT) Received: from [10.57.5.217] (unknown [10.57.5.217]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6AE613F762; Tue, 4 Jun 2024 23:54:26 -0700 (PDT) Message-ID: <643a7106-921f-4916-9f48-b979e0b5b4fe@arm.com> Date: Wed, 5 Jun 2024 07:54:25 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 2/2] sched/rt, dl: Convert functions to return bool To: Qais Yousef , Ingo Molnar , Peter Zijlstra , Juri Lelli , Steven Rostedt Cc: Vincent Guittot , Daniel Bristot de Oliveira , Thomas Gleixner , Sebastian Andrzej Siewior , Alexander Viro , Christian Brauner , Andrew Morton , Jens Axboe , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org References: <20240604144228.1356121-1-qyousef@layalina.io> <20240604144228.1356121-3-qyousef@layalina.io> Content-Language: en-US From: Metin Kaya In-Reply-To: <20240604144228.1356121-3-qyousef@layalina.io> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 04/06/2024 3:42 pm, Qais Yousef wrote: > {rt, realtime, dl}_{task, prio}() functions return value is actually Super-nit: s/functions/functions'/ ? With that, Reviewed-by: Metin Kaya > a bool. Convert their return type to reflect that. > > Suggested-by: Steven Rostedt (Google) > Signed-off-by: Qais Yousef > --- > include/linux/sched/deadline.h | 8 +++----- > include/linux/sched/rt.h | 16 ++++++---------- > 2 files changed, 9 insertions(+), 15 deletions(-) > > diff --git a/include/linux/sched/deadline.h b/include/linux/sched/deadline.h > index 5cb88b748ad6..3a912ab42bb5 100644 > --- a/include/linux/sched/deadline.h > +++ b/include/linux/sched/deadline.h > @@ -10,18 +10,16 @@ > > #include > > -static inline int dl_prio(int prio) > +static inline bool dl_prio(int prio) > { > - if (unlikely(prio < MAX_DL_PRIO)) > - return 1; > - return 0; > + return unlikely(prio < MAX_DL_PRIO); > } > > /* > * Returns true if a task has a priority that belongs to DL class. PI-boosted > * tasks will return true. Use dl_policy() to ignore PI-boosted tasks. > */ > -static inline int dl_task(struct task_struct *p) > +static inline bool dl_task(struct task_struct *p) > { > return dl_prio(p->prio); > } > diff --git a/include/linux/sched/rt.h b/include/linux/sched/rt.h > index a055dd68a77c..91ef1ef2019f 100644 > --- a/include/linux/sched/rt.h > +++ b/include/linux/sched/rt.h > @@ -6,25 +6,21 @@ > > struct task_struct; > > -static inline int rt_prio(int prio) > +static inline bool rt_prio(int prio) > { > - if (unlikely(prio < MAX_RT_PRIO && prio >= MAX_DL_PRIO)) > - return 1; > - return 0; > + return unlikely(prio < MAX_RT_PRIO && prio >= MAX_DL_PRIO); > } > > -static inline int realtime_prio(int prio) > +static inline bool realtime_prio(int prio) > { > - if (unlikely(prio < MAX_RT_PRIO)) > - return 1; > - return 0; > + return unlikely(prio < MAX_RT_PRIO); > } > > /* > * Returns true if a task has a priority that belongs to RT class. PI-boosted > * tasks will return true. Use rt_policy() to ignore PI-boosted tasks. > */ > -static inline int rt_task(struct task_struct *p) > +static inline bool rt_task(struct task_struct *p) > { > return rt_prio(p->prio); > } > @@ -34,7 +30,7 @@ static inline int rt_task(struct task_struct *p) > * PI-boosted tasks will return true. Use realtime_task_policy() to ignore > * PI-boosted tasks. > */ > -static inline int realtime_task(struct task_struct *p) > +static inline bool realtime_task(struct task_struct *p) > { > return realtime_prio(p->prio); > }