Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp196245lqj; Sat, 1 Jun 2024 14:34:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXFIy5Sptz8WM+RQo+ebpa+FvZzj4e/WvP/v+LUSYbR5Q9+WuHkzlY122ptRps1iN7HWccfUb22Zl4pJboPUwc1m9gRFYBuN1MbnqF2WA== X-Google-Smtp-Source: AGHT+IFSo2y8Re5g1APT0fhRn9I3tdRv0Io6/GVXiwq4VN6gjjL5cZcFYVYHA+U/Lj9Er5FDD4Yj X-Received: by 2002:a05:6a00:2d87:b0:702:571d:2de1 with SMTP id d2e1a72fcca58-702571d4342mr3092961b3a.18.1717277652099; Sat, 01 Jun 2024 14:34:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717277652; cv=pass; d=google.com; s=arc-20160816; b=mNKrGfuOL0Tv8OOEDX279aoWhM/FjKpH78pHucfMOyF+DuOGlIeBG8hGHilLjZnY0n UTCDLxkDyzHrC4iX0ICAbLh4DuIUfNdrZMoSdiTjtPvtId7LbZYZY7sYi4rlccUg0/1h +Jd0J97Y+HDuso48DTEHmaAb6sLF9i7Ytsmjka5wwnY1Xg0isFVcg3+OIaLrjAMjGNoq IyPn8Lu7GkyO898BiZxmiqM4zyQdNBHutn3qdWKdvmjKhFSDtO7Mni35n1YqViq2nfCs bUFdEPERNSF0xF0gMVzQqMsBQWGLqp72q8DY3zXBHZ5YZtVCcno3p5lYQOVrg1j1kLX7 SnDA== 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=3sT0UxPJVsFvbizWQFXaFxd+myFLbvt1Djq9NxHiO/k=; fh=jICoU27kNMQu7fGrMJ1K0Qpsx4ColxdsDoQl1GbAwGY=; b=mH+EMVik29Jvv+N7XtsG9FuxbcYB5StjrX6h3XzGSHzuaXIm3f7AcaMVcwp4HSA5vS PUxCgsDIDD6Q4J/X1/HITrqVMYp2VU1WLQpkwO0FfTLeC/yAj6Z4UphQZvxD8hmaZsmj /YgiDi1rAv2JoY+dXqsz6XEizINDmDTUgOaITcRnnMsgRTZWxW9HtQHrFZ5f4SrXsFNf DysMUiI/kcD17kxANbuRvf0LpG/0ZUAS8JS6DlAme5l0s36mMavku/uBpaTBsz+NpfHq 62lww+eq4hqf7Tu2N52+pShxTM6iU/bY47rqwtEgHBuBwKGLLoUmvV19n+fuDalDfDek i2ag==; 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=gsCHRutT; 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-198013-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198013-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c3540f8253si3977252a12.179.2024.06.01.14.34.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 14:34:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198013-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=gsCHRutT; 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-198013-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198013-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 870A2B216CE for ; Sat, 1 Jun 2024 21:34:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 677B34315B; Sat, 1 Jun 2024 21:33:36 +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="gsCHRutT" Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (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 CD0AA21364 for ; Sat, 1 Jun 2024 21:33:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717277615; cv=none; b=QjpR4yRIjFRllPKAtxolvI41Yi67mDCBpvmHaS6YHqW4jNfmck6LJesRLNibrSxWdapClb/F3N3t3ruM2u4VR3QJbIT3zZqVWPgfEF+3P+Q8FH6Pn2T+ov3JERprDzq9ZoERHp89MJyI82Kw/SDCKo8zSaF+jH8sOChYF1js4No= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717277615; c=relaxed/simple; bh=O8JuXN/F7C9Ahr23boiRySLU30zszNQXarX6RobRxdc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=L8JGiBI75tx8MtaY3PMS927uW+mPqTxevCZgESsfjHiJZldw06m91l5iorFIbk0YXN7+OPuBw+fg9Amqf0yNUUBEu5FExICj/reE3+d5Z1D1fmaF5ETWezPDDASjQS9l63dQIDyQFIGMHyxJWLRonUsBmJcsUkwdfVvKw9dX1ts= 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=gsCHRutT; arc=none smtp.client-ip=209.85.208.181 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-lj1-f181.google.com with SMTP id 38308e7fff4ca-2e95a1f9c53so39785541fa.0 for ; Sat, 01 Jun 2024 14:33:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=layalina-io.20230601.gappssmtp.com; s=20230601; t=1717277612; x=1717882412; 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=3sT0UxPJVsFvbizWQFXaFxd+myFLbvt1Djq9NxHiO/k=; b=gsCHRutT+kkmDaDw99jdqRf4h1xDF/cC9Jm4Ym/eV0Ly4NNEN6JdUMV4lgMFGJx26Q 08fT9CRM5LZSvPxdS/JZ52OPmwPJYJG46ca9sXEqrCqwCxpcdGcMHjXduDQDpDPGR6rj RmYt2I7xUPy4YzZ+qseoBshXeMlrFd57aiK/LxtqkCTvTkXNua/yOlg2QJIwSykoozRR F0KaTZegWZI3PpfgRYvwINALTlsKABcK8W6+p6r2ri9Q5RFhkqY7FSk0Vs4zNW2LVWFI nRrf2roBbiYoXd8SnU3/9F1X1uNLlxOvs75pdkbQMMvw8NnsS0Zzy2i3dYBcGTmsVIah lFYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717277612; x=1717882412; 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=3sT0UxPJVsFvbizWQFXaFxd+myFLbvt1Djq9NxHiO/k=; b=sZnBbDA1uQYGLIm0GK3LQpK6Ul1Gnyt45FDPRSu2+nnhwPC293qW4EW+HiTtCYJjSN s/rYFmpAdUrFlNFrUKkOVQYVIFpCPDUWO7yJoNgqrZClRbPvc+X1pzLHtWmtH4+TmWvH xv9QbckNGzt/D7ZvWBSppWJ0VY02VGbzP3RFk3e3mfPVgYTyQf68fhOgFT1av6RVVeuX HBBKd7fzebkO/jhP3pSpv/+lIzzx3BJkiOB8Ulzlnm9Hnr3kOWP5mzidIoNwyniCcSCx 4aNHs9BvXx2sFJMAch8NbUJIJXJH9pzQEkn6BmZcWAYLJisOav/h5pwXTDLXjk0Kmv6X vAwA== X-Forwarded-Encrypted: i=1; AJvYcCWPZIMJ3JZZWsqDdajiS3B8tAIK+3iAcds4WRQm5zR3MvxKKGrZrlesCAmf6X71uid62qPBywDPvww/y9+KNDyvhPJQNMsyRAVw3mzD X-Gm-Message-State: AOJu0Yy0al+SHfHxLJe7bL266OGWDCxuANCCI5ItJnqGyuIG12KeQ0l1 wTT2T6/Cr2XveWTfuexlp0pkVj3LpXMd8+YrTVWX6DYJ2n8aKaLtAAbqwPyKq1k= X-Received: by 2002:a2e:8e62:0:b0:2ea:7954:3777 with SMTP id 38308e7fff4ca-2ea950f8c22mr29792601fa.18.1717277611480; Sat, 01 Jun 2024 14:33:31 -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-35dd04c0839sm4751324f8f.23.2024.06.01.14.33.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 14:33:31 -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 , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org, Qais Yousef Subject: [PATCH v4 2/2] sched/rt, dl: Convert functions to return bool Date: Sat, 1 Jun 2024 22:33:09 +0100 Message-Id: <20240601213309.1262206-3-qyousef@layalina.io> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240601213309.1262206-1-qyousef@layalina.io> References: <20240601213309.1262206-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) Signed-off-by: Qais Yousef --- include/linux/sched/deadline.h | 8 ++++---- include/linux/sched/rt.h | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/linux/sched/deadline.h b/include/linux/sched/deadline.h index 5cb88b748ad6..f2053f46f1d5 100644 --- a/include/linux/sched/deadline.h +++ b/include/linux/sched/deadline.h @@ -10,18 +10,18 @@ #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 true; + return false; } /* * 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..efbdd2e57765 100644 --- a/include/linux/sched/rt.h +++ b/include/linux/sched/rt.h @@ -6,25 +6,25 @@ 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 true; + return false; } -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 true; + return false; } /* * 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 +34,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