From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BBAEC25B76 for ; Wed, 5 Jun 2024 06:54:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9B0026B0085; Wed, 5 Jun 2024 02:54:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 95F206B008A; Wed, 5 Jun 2024 02:54:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 84D986B008C; Wed, 5 Jun 2024 02:54:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 690F26B0085 for ; Wed, 5 Jun 2024 02:54:33 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id DCF6CA0516 for ; Wed, 5 Jun 2024 06:54:32 +0000 (UTC) X-FDA: 82195921584.01.60C996F Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf29.hostedemail.com (Postfix) with ESMTP id D532612001C for ; Wed, 5 Jun 2024 06:54:30 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf29.hostedemail.com: domain of metin.kaya@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=metin.kaya@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717570471; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/WNbPbpU/fQWtiztCW4AK9aUkRXhBMbAizMh4fqXM7c=; b=ztW6lnn0zkydD0TeQAU67JRzlflRWn86AY/K+BOytZF1BTrMEk6/RDI2+m655x1TSgW50c ++658sDMeIqINfvfN3GCX/BOe+BXX4sfhb46+D3S6qhErNa3pTnmcXNiArEj0ppCO07OBj ykuD6c0/yD4F6PPnakLqBGuU/pJHUHI= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf29.hostedemail.com: domain of metin.kaya@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=metin.kaya@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717570471; a=rsa-sha256; cv=none; b=F46pflf6/H7I0w7SSqAsITJO+6xHRTTuDUFZ0oMcTzI1Ao3ZRhcwJA6aSvgP0oM6UWfWAq 4+cXm36644uBlVFrPm29bLgZtcADjSpmFfpGeDpp/hCiJ4JPKRL5riI4m/HE+6/CcCTJBW fgxcUzm9J4u2ibIIYAf+bptd+LIvNuY= 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 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 X-Stat-Signature: 7nqzwms6cntxrpxawhwxg5fe3kcnbdqj X-Rspamd-Queue-Id: D532612001C X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1717570470-860599 X-HE-Meta: U2FsdGVkX18zFCq26vkk9rGWyx6OtmlaWr0RoIUyABueXAY0PzkiydlquMmfLsZxhkzS1Kk8LIud81aVWYMoP+HaZzu6eN9TRpcVPhWFDAUBal3TttDt9m+Dw3zVGaPnmwiT+vcPcWellPKZqCFWlEapU8mxPyVsxW3WwVQvBuoT9bVFivh6efwbUSd9zGvWxMOl1Eg0eUViEjDaXX/zE8J9F7fbW+C4MEwdaAj9pu5d3oWY55qhPe+Xxlz1UgTHHFXgwN72TBWS+HPoy86ATeqLU93NGvj14O0cv0rz5BdIqSLtCiYs90Ygn0FarKQhcRdRkCoqOooItowyd+8VJIuzC0dHQET3/5lV4ifzsDd7LwajxVILj4YKuJF46FhJMBs0PzkEaWltv7blEtUiiUPAa7q5MAqI4t6CgreiW3dI9o2xg7T6ji59vNTDCafBYc0nZ4rldutqbTO+5hQiTFXR0YfoXu0oZekrH9aPLnwrH0SfSSIeB3ds4nMS3I1HuAyKgxQfZEctuS3sNkR3n1NIkKUlFZDzto37oyTMxObk+FX6I5QdfgK3FbnXPo9Dsn6QjkWCYoQ6wGbDmOJkkpklA4+zFqbOINhQSowisIeFwDfotSzBQF/qDRmM/EIe0Iwyb9TBbqaBt1E+ERpaQpa87H+vXmzg89cVmXZsLscMdA08ALZoUPeUXuecsIY7yP/ZLU0ZtpN7A+jURTDZCrzOb7AUu5i4+T3OeOZPD7w5AYeqzApTAtLYINVKhy/7yFbtt1uY9KO4ZM7ngHlLBYds7NOWKatDNrtNdsMy7IUfvsz8ZlrwahsJ683gHCaogWb0dYE5SN5yzkIojtmg9/P4vjsVBufZVUnpr+NRz8FYAtAOKyu2/i3FDVmjJWtCJi2IhffqxENUhFF+jDR6NBhbvjKkaPMktL/0dDSGCldJxa0LcB2iJRIxfMLgcLzMWRcSZA9Pbv7oruNOcEy ETV3I9FC oRZJ4+H4ybK2rWHIa0TGhacVEB/dyRwqnXYznp8o7WByDPrXOdJ0Jw6OyKhzbiJi7Dt9TLAvld9KPSYWW4did05Zq9+SNYCVSK1JkE2z5gcHvkRfnrEpSdJaPIqLo7w2qK5qc4Njkn8MhWduMJe4m9BewuKa8XtJqGEiqWQXIs8U0hRKULU//7HRNdaXNeiuFn7+OSoAjwFuIjlhd4q5e6coTtt2GSKVx/JnlW7KqXPofjRnXtIKHIE4PIER+kzwytOnQ5PobigUxNOo= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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); > }