From patchwork Sat Jun 1 21:33:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qais Yousef X-Patchwork-Id: 13682559 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 DD8D3C25B76 for ; Sat, 1 Jun 2024 21:33:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 18FFA6B00A1; Sat, 1 Jun 2024 17:33:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1186D6B00A3; Sat, 1 Jun 2024 17:33:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DE93B6B00A4; Sat, 1 Jun 2024 17:33:35 -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 B1F566B00A1 for ; Sat, 1 Jun 2024 17:33:35 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6BDFBA1481 for ; Sat, 1 Jun 2024 21:33:35 +0000 (UTC) X-FDA: 82183621590.20.43B05B7 Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) by imf28.hostedemail.com (Postfix) with ESMTP id 8C103C000E for ; Sat, 1 Jun 2024 21:33:33 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=I2ZROOxn; spf=pass (imf28.hostedemail.com: domain of qyousef@layalina.io designates 209.85.208.173 as permitted sender) smtp.mailfrom=qyousef@layalina.io; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717277613; a=rsa-sha256; cv=none; b=ZPUqIeik6JkIlPgfCx0do+MXz646lIHad/6tJYvufJh5vJ7/mTnLrZqwufkWq2YjGf9Ba1 v8JX/XTlEEGnz2FRSyjcXe8SWe9uCWv1BlKsc9efho/vU3QnvKJNieRJ4bbseDS+/dG5pW a0pzI7nVhqMa5HMysodS8Z2Dj7mSl6g= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=I2ZROOxn; spf=pass (imf28.hostedemail.com: domain of qyousef@layalina.io designates 209.85.208.173 as permitted sender) smtp.mailfrom=qyousef@layalina.io; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717277613; 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=3sT0UxPJVsFvbizWQFXaFxd+myFLbvt1Djq9NxHiO/k=; b=hQo2CeRvFWhkygYC7A8ZgPBgginnbS38fHu0YmkqBCAAjo/n93s17PkabrVf3VwkuPy+8H Xeftrr57eX0Fxjyzq6GtFMWyRugT1AuEktSqXJzpOWlH8oQDPD3X5w+P6FHxO4C8k4exiy Qk4nAkDxI56aNBLcNlB3pq7GFtkMWLU= Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2e96f298fbdso33245851fa.1 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=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=3sT0UxPJVsFvbizWQFXaFxd+myFLbvt1Djq9NxHiO/k=; b=I2ZROOxnEPF8sSZudLEAEadtetGoX9SFIPZEHs/yMLInoBc/NwIL6Jn+f3PW48uqBA ww09rJY1k96eo/6iZwcsgmeNyG4+ysaSFLpY+Y/RvkzxERU6yGIWtPYmaw9jhwfNOUNB r30KFamRQz4xXjCq4mutsEU9pQ42PuKz2dJfFZKKBzT7qhJGhNYuX2GV7fmscXvjD2qi atL03CxaMmSo/TDW/5N7oAkMvZXjqbf5CM6/rk8P6/Bq2SoEkqciqjYL/KqQEzwZKuQT kXnZ42Wm8N8OHbaj9FSRhmkmyuby9fNUVhSpUR686+BEW/sVNT3zNxSAnPGK3q5b+2kS DaLQ== 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=eEPEmVungEj+632TEHuhrqmXeu+tyDlJQOo2shjK9PeaSL2AiYEgZR79atPXpXSkr9 AFsyZ+ezG5B3mcsCBeMT8XnKgYb0v4Vs5vi6Qe2a+aOxQQ46jDhrlDO9+B08CA5TfZOu JrzQTBiUS/iRDvd5mQeNoUk+tCPIsKqjj7mUKkgPunogM9g8f1PBL07BA4pTC/Xhy8HI ln3J9Vj+mEpHUApInZqSKeyx56yBwDmiA0VyLJSseSgJPwidPiwdOA9KikgXbS80n3X/ QI8QzDW6hek9bHMms62QOPRxl4YEdwe8Tj1C88DkmlHCkXOC+gjVYpagfUaJJ+fesTtj pKWg== X-Forwarded-Encrypted: i=1; AJvYcCWWVMvzWoUrsj0MJVNMvJY4x1k6oQ/LTelx+GVvPJ254k7tpVFG3D94u97Ujqgcv8rilAWrk5KC62tJbtrTnQLmtiU= X-Gm-Message-State: AOJu0Yy3XkU/GosZ9LJ5hotSmoURktN3LXqkZkhgPnVKcEOiPyViO8qT Jd5hhHrWJnpg0PuVGPYfrPYj/KwCah/h4xEsB6tVnZfbAIN+9ujQPMf/rSkcPqQ= X-Google-Smtp-Source: AGHT+IHTtXDQYUCHcup+VdBP7H+9TJT0tVCvzBLqaigZ6UCn3zIJ6feyXGCuTgk0t3iYmSADXLLaag== 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> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 8C103C000E X-Stat-Signature: qzobi4bznydhc7hm6hfc7yfg14gjt95q X-HE-Tag: 1717277613-779997 X-HE-Meta: U2FsdGVkX1/bRctxrNT1gZBEVFtkr9pmQ4bHqJKs7SP9EJBvKfKuZx05X9Jz15jfrV67DKqEs0sA81lDvrUta44zUN2ODCvNjkNY0EwgmB3CTKBL5lDWlgyt1mdoJgAe0Yuf8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kt42J1BUiPQNiqVMsoM1l3C91V3uIfiDrNVBgSmOvVyVIrHo5HyDSQVX6LP9JqNe7SB9Md4y0gQvIjdoq7AIpg1dVa3JDc+mq30I+JG8BGqSuovzHRB5B4IOQkzJe0edKLgibGGaEavcaHNQ6jvx7N1RfquA+mof//u7PObayY5TBSP4kzkX+yYFPA28H/qEE9r0lorp9V2jEPZqli93S1l3V+jmxSFOA60W 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 --- 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); }