From patchwork Tue Jun 4 14:42:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qais Yousef X-Patchwork-Id: 13685476 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 B6630C27C54 for ; Tue, 4 Jun 2024 14:42:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 333EF6B0088; Tue, 4 Jun 2024 10:42:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 247466B008A; Tue, 4 Jun 2024 10:42:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F174D6B008C; Tue, 4 Jun 2024 10:42:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D715E6B0088 for ; Tue, 4 Jun 2024 10:42:48 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 79883120613 for ; Tue, 4 Jun 2024 14:42:48 +0000 (UTC) X-FDA: 82193472816.19.AE969AD Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by imf01.hostedemail.com (Postfix) with ESMTP id 8493540024 for ; Tue, 4 Jun 2024 14:42:46 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=Nq0VieFI; dmarc=none; spf=pass (imf01.hostedemail.com: domain of qyousef@layalina.io designates 209.85.128.48 as permitted sender) smtp.mailfrom=qyousef@layalina.io ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717512166; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=yRCAwCBL+BIsgnWJn4hsN99PIDBFtmRQDHcbx/zD1tU=; b=Lt3Vi4WjX4p+tSqjCQGI7wJCrukBv5UGHkOcTrRJeMP93UqE0A5AR+Y1KFUFE7B7xD61ZQ aqpEPBB4BRqq5skqR7kn0/U5e/8nY8Wm7WjMIrSmD5FmaQnu8MkuGZpEF32J89r9nBi6TQ 9/gXdQKjwtl8mZVWt3iLatpkI2+Jods= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=Nq0VieFI; dmarc=none; spf=pass (imf01.hostedemail.com: domain of qyousef@layalina.io designates 209.85.128.48 as permitted sender) smtp.mailfrom=qyousef@layalina.io ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717512166; a=rsa-sha256; cv=none; b=c4u2jWZc/Ks+tBhdLSc9stSpUeKQHPmEc9FUC/rDSlcyjZ3yNDrHyy22Rg85nwQvoz6weH Y4d2CerlNb08gvB/vgx5o8c4H7szF/3YdBI9LpgIbX5mvbL1cOeL3vc2M9IROhaNLSLf0U ozEX1wQdABQNdGJxrOlxApa+HZqChME= Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4213b94b7e7so14739755e9.0 for ; Tue, 04 Jun 2024 07:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20230601.gappssmtp.com; s=20230601; t=1717512165; x=1718116965; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yRCAwCBL+BIsgnWJn4hsN99PIDBFtmRQDHcbx/zD1tU=; b=Nq0VieFIYfnHWVnh2taRAGPT+T9fhIR0NBFq2CnpCW/Ah1kkgcqkZU1P5FWfSQUOEk XlPPakClsMKhlRlnwlUGwR5KO4bc03KyxnVs3E8VEn4/135lMZk9VFLcYdozfP57jv++ 5empM7K+JZcD8Yau7NG47d2nwM21kbpJrQ/v2ZDBUfIXXm5ViIl+1Ne6bIhIGqoubFag Q7dVotaPQPb/EOaZvrMDA81HrzzmkeOB1yJh1Q9IIHum22e95oWzZr6gzn8PHFhXhsqW hY24tQUCd5T2qqhyfNPLq0KlgOAa5tJtFdAHj62NuWuuDt852Y8xXyd4VwnvYztj6k/G yxSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717512165; x=1718116965; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yRCAwCBL+BIsgnWJn4hsN99PIDBFtmRQDHcbx/zD1tU=; b=HFIFAgkRYUUquBhZGPF9ExDBpE94eOPIxbXAbExVPIL013PKdzM3QE+zh+lOMYb/ov MLyfTz2+NncxkwmsXouGOw39EjJvQtiQVjMKnESBbrH+d4sXMx+aurxFlIhzBuAjJ7Rn AxbW1/NBblaE4U47A+dqguFBy2Sajzz6x3zcg5lkKCQJjr3ILRS6NlcFujCG1M0iIY5H ojNrwTqwUyP9rybccf6R9crlC9R6RFSDq/qqkPdDm2flgEGtxItai/QmZUzNQjjd6nml TqrIt/xUsHDXAY7vUCXmacDESqFrcStxK+3B1v3txWAxkr43qtMFirlQ5iHEDTWVu0X4 pkZw== X-Forwarded-Encrypted: i=1; AJvYcCVRnb304TuKwmjeSs4S/UQCFd6D6H4B6byE2R45UpdTtENyT4FjsBshx+SQt2APCC/cr6rL7bNbOODEvCKPjnx45jo= X-Gm-Message-State: AOJu0Yz9UoUf8Jo0x5Vj4rgF7YLej1lA+hJMo65x/GwhjkfK2dA4juJ6 dhu+bny8Pa5yj47HWDiRLfDUDt+ynOU1rhMQuDvVjY0wBOJuMcqPoW3YKHPJMmI= X-Google-Smtp-Source: AGHT+IH0BLezorijkm6LilA7yxfjptfWPVcGAoCl9lPMtaigyEyQH11++G7gyrhU4E3tJmmgdakkBA== X-Received: by 2002:a05:600c:19d2:b0:420:1a72:69dd with SMTP id 5b1f17b1804b1-4214511cb66mr29747005e9.10.1717512164925; Tue, 04 Jun 2024 07:42:44 -0700 (PDT) Received: from airbuntu.BoongateKia.local ([87.127.96.170]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4213eca8a51sm62423295e9.14.2024.06.04.07.42.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 07:42:44 -0700 (PDT) From: Qais Yousef To: 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 , Metin Kaya , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org, Qais Yousef Subject: [PATCH v5 2/2] sched/rt, dl: Convert functions to return bool Date: Tue, 4 Jun 2024 15:42:28 +0100 Message-Id: <20240604144228.1356121-3-qyousef@layalina.io> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604144228.1356121-1-qyousef@layalina.io> References: <20240604144228.1356121-1-qyousef@layalina.io> MIME-Version: 1.0 X-Rspamd-Queue-Id: 8493540024 X-Stat-Signature: 8r3b97744x5g6qnir4yrznymib1cd46y X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1717512166-331418 X-HE-Meta: U2FsdGVkX1/S3BfidnoQq7Uvg/AqdEpKK3g3+Es5fm36KzOhrQeZ+zKzeAhfxDIjzYMATkf+GNOfOLfRBpncfqYYDkraZ0uS5JNMLAnS1fmIYUlmkQJwmkB3rJybnGx+rhKMifZK0bull18klLyPhChVVhyQnIqvBJ4zjhYjnx/eaIUh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BAl0W15Eva7j0On02ZxwbawUPxY0jkqACgKHrjyv6i/q9fjxZ7M7EvRFG0H4D3h/u3+Ngbi95nkiJjL6g2P/3OxTezVJ2fdhtXy7HfDxp/CWWzELw+HoCAFJl4hLq23LlnVIWg5icdHTNdZ0/Ju0GrloYSuYYDuCwjnchCHL6PUTkeQuknGVyUF95SxLOjn7eTrhQVwoNrGw 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: {rt, realtime, dl}_{task, prio}() functions return value is actually a bool. Convert their return type to reflect that. Suggested-by: Steven Rostedt (Google) Signed-off-by: Qais Yousef Reviewed-by: Steven Rostedt (Google) Reviewed-by: Metin Kaya --- 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); }