Received: by 2002:ab2:715a:0:b0:1fd:c064:50c with SMTP id l26csp51692lqm; Mon, 10 Jun 2024 12:21:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVelqVlbPPwIYh0hkpISp8+Hia2LosO5CiNYs0xfh2qcjJONtRbsUShYUYXZDcXaZBz76FiolkoOXvkLWeS0vXmE+fM1u2imvI6MSx+Kw== X-Google-Smtp-Source: AGHT+IGW6ceGp29kAbSF7TdrkWuCpK8Sax91Z5aivHWGtgQOTYJizm+tJoeIaIvh1ccP0HY4POkv X-Received: by 2002:a17:907:10cf:b0:a6f:11f7:e8c5 with SMTP id a640c23a62f3a-a6f11f7ede0mr316396366b.12.1718047279220; Mon, 10 Jun 2024 12:21:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718047279; cv=pass; d=google.com; s=arc-20160816; b=UhxFxwgVoFVyBS+98XaRucNW83hgD1HjM9RLuNhIq+ZTvEYn7JV7kr5xo8dltKopFR eXpi0spE+TVjQxNxx6lXzCykSKXj34GC0V+lu7TsfiHB4/Z+kpF+ylg68ZPhCw1na0yf CmTVI+EHZRkpXoYz8HW1eZbR24AAm1+7/t286o+pEJhKFcW9bHNkbsfE5HUowmnj+VWl V9puFrHOuS5489qln9s27iPhgJniewoX/XtImh7ADT+pTS6UhGFYZUL6eL7cfzgu+jd3 bJtp98AHrZcWGQD545E0hSC8K+2FLmCDSzFwyR42ot1UMHJ5Ruo/p8XX+qzyKpA3Y5zd Gxww== ARC-Message-Signature: i=2; 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Aqecuk/j+cWcR1uWGatEcThGq+5RIRJx4qSyiIgAFX8=; fh=v9bxhBONIVchOCnI7oalVYeubOBZP4IfNJW41EZUIIs=; b=OF6HVP4xPJK7hqPiqJkccZY8CrYMoHUBfV/j/9PgOrRstAbykhFatOnCWG6D2XlALu UdNiKYAg9NV/3+ja6ALA3AbuScRN7Zm3MmMu68hQurX9UmeOusEGMkbUpE02V153wrRv Y1h7B6e7eXYipmSxnLEkRQ0RJiOwyrf+l9QDRqRvJdq9LKmylhPOBLxNBmFsj7/cyaoL NR/iOiLSqP3a1gu2hjlPB2Fkw0yMtpkfsCn+FBElKpMjFnU94zqNioPd8epIcgalHxQA a+SKRG2KSmFYXjzAOaJLrCa4XnfWyFzyFyuy8CvhkMJLsSpJvs7s4PiqS8oUCs4eqquo PZxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=kiMlit+G; arc=pass (i=1 spf=pass spfdomain=layalina.io dkim=pass dkdomain=layalina-io.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-208786-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208786-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f1ade532csi152805966b.728.2024.06.10.12.21.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 12:21:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208786-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=kiMlit+G; arc=pass (i=1 spf=pass spfdomain=layalina.io dkim=pass dkdomain=layalina-io.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-208786-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208786-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id C27951F22663 for ; Mon, 10 Jun 2024 19:21:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 889451509A4; Mon, 10 Jun 2024 19:20:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=layalina-io.20230601.gappssmtp.com header.i=@layalina-io.20230601.gappssmtp.com header.b="kiMlit+G" Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 105B914F9E0 for ; Mon, 10 Jun 2024 19:20:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718047227; cv=none; b=ShbJtDH82NxcYFifz6fsxdVHeKC9PN7SdrAO4DD1ZsFehxGGBnrrDc3hb++sfun7qboTqYH+vops1N2lJv8HI9sTkfk/wgDjpJACkRoFjit+b5j6XZDmnVuB2hXT8Ji5ZHogJ7VStfxTmPCNfrLv3H7ruK/xcs51SATtGGzLNZg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718047227; c=relaxed/simple; bh=osm+qh/Kr8Orx2ri9MuXrY6lmGDiwIyif5UE65dXUnQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NBVLN86EAyy3iJoE5ZfwkjB5/v695u71DjTvLpjIdEQUfmVlf6KEikxO7rVMpaPmWa0Dl8CIx6G1iNAvha/vC1qHRBMcbRC0LkP7kRHMjrHZttnsOYQSUHMmTxRIdVikWQcQrnErEq4CX/twhCrzEL40vv/elT7PmdyWKl9+nFI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=layalina.io; spf=pass smtp.mailfrom=layalina.io; dkim=pass (2048-bit key) header.d=layalina-io.20230601.gappssmtp.com header.i=@layalina-io.20230601.gappssmtp.com header.b=kiMlit+G; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=layalina.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=layalina.io Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-35f2266edd8so302809f8f.0 for ; Mon, 10 Jun 2024 12:20:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20230601.gappssmtp.com; s=20230601; t=1718047224; x=1718652024; darn=vger.kernel.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=Aqecuk/j+cWcR1uWGatEcThGq+5RIRJx4qSyiIgAFX8=; b=kiMlit+GmFjSMWn6OuG2lnGiGvsKMkKT+9KCH6n5wBuko6t5jAUePVT4M6IwV44i8Y zvH+hmTrYprMZcDllMGv2UjU3Yjc7Fyr6rkmnNVDiERq8z4AZpOQr4HxsEKrYPwkJ5LY J5huvnzo8Qfbm5w4RH0CLR8TG4sM/KDm/H0ipidNRA1STmbLjl91wsP23vulTB9/t7J9 u9cUOVubf4ECsN1EBfWy0ldp94VTDzLIC6o+aDf9u6tM4g64oxF29WW98gKSrUhr7SH1 6U4iIYcToi+vq6k3tSAAiGZUy51wuL9OxjpaY4Hlp85F4AROKLGHlC6eBUrNEaSkhdXx rbKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718047224; x=1718652024; 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=Aqecuk/j+cWcR1uWGatEcThGq+5RIRJx4qSyiIgAFX8=; b=R4XQZ/XRxJYRqStfSm+fCz+51vAD/weE1NMTgIoIJsj7I0/b7gR5kullLDWTS9EA3L A62GRKbhXjGpKkeH4R8qgvPveDRiVpxIqrUxjR3ztHhuq2IbeyzWUixUoPPcXrsTLWLY 0JEP/D2A07+XRHkNhRCn+6Hg9eQzdZ2bz3b7R4GxQZbuuhlkyoZkS9aROBynBJILvkMr s/XpqfebsHfZ6tFYlnf93uOjMXlNPDazJfL7zROdKa97ZSDUULoiVRQ4AhMx2XdXv4kL QcW7LI+OHrhYzZwAVgQOeAMeoSgjD99jXfFG5c++k+3oqMwZNZNddljk0YMeGArkhat3 rZUA== X-Forwarded-Encrypted: i=1; AJvYcCXQAPcugwe5dw/AS6p44L+CA7SftsL+b6IHD/kADuuQZ9y2tCSFdx/RM/1bd8yHq3y95401m0lCuplaVAQQpiLaTD0Q5mNu8hpW4dcf X-Gm-Message-State: AOJu0YyDVBvboBqpQ8EWR6U4D4FYkFv25/PudtZRtz9BZkl3yiSp9Yps u2GG59g3WQWlyW12GIWhUHP58OTaoVWTMj5111sAPlSsGMqiREYy+y/jfJDFiEI= X-Received: by 2002:a05:6000:154c:b0:355:2db:a0e with SMTP id ffacd0b85a97d-35efed1e599mr8511407f8f.13.1718047224576; Mon, 10 Jun 2024 12:20:24 -0700 (PDT) Received: from airbuntu.. (host81-157-90-255.range81-157.btcentralplus.com. [81.157.90.255]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f1f30c3ccsm4988326f8f.7.2024.06.10.12.20.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 12:20:24 -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 v6 2/3] sched/rt, dl: Convert functions to return bool Date: Mon, 10 Jun 2024 20:20:17 +0100 Message-Id: <20240610192018.1567075-3-qyousef@layalina.io> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610192018.1567075-1-qyousef@layalina.io> References: <20240610192018.1567075-1-qyousef@layalina.io> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit {rt, realtime, dl}_{task, prio}() functions' return value is actually a bool. Convert their return type to reflect that. Suggested-by: Steven Rostedt (Google) Reviewed-by: Sebastian Andrzej Siewior Reviewed-by: Steven Rostedt (Google) Reviewed-by: Metin Kaya 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); } -- 2.34.1