From patchwork Mon Jun 10 19:20:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qais Yousef X-Patchwork-Id: 13692379 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 4D4D9C27C5E for ; Mon, 10 Jun 2024 19:20:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 65E4C6B009B; Mon, 10 Jun 2024 15:20:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F0386B009D; Mon, 10 Jun 2024 15:20:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4616F6B009E; Mon, 10 Jun 2024 15:20:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 1DEEF6B009B for ; Mon, 10 Jun 2024 15:20:28 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id AB4DD80128 for ; Mon, 10 Jun 2024 19:20:27 +0000 (UTC) X-FDA: 82215945294.30.B4AE4D8 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by imf17.hostedemail.com (Postfix) with ESMTP id D3FD040018 for ; Mon, 10 Jun 2024 19:20:25 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=g6H2CByY; spf=pass (imf17.hostedemail.com: domain of qyousef@layalina.io designates 209.85.221.42 as permitted sender) smtp.mailfrom=qyousef@layalina.io; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718047225; a=rsa-sha256; cv=none; b=qGTFsUsTe2xproWNx4F/uTOS+H6oZ5iOQu0Kap0vLYvlgvpVabxt1QWlUrwqfKFsKdmml1 1yq5Q2PoQy7XZDOPEqjzQ9kCUbCbXN2JnjWgMDbqHhZ7G7yr0cr/FmHuILlVf4OJgMgyh3 aZzX5HUsZYkPlGnRIRf18ncmtb0BQWA= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=layalina-io.20230601.gappssmtp.com header.s=20230601 header.b=g6H2CByY; spf=pass (imf17.hostedemail.com: domain of qyousef@layalina.io designates 209.85.221.42 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=1718047225; 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=Aqecuk/j+cWcR1uWGatEcThGq+5RIRJx4qSyiIgAFX8=; b=U+SYytpv7quf3zt2tKLS4sb5XFsjOVS3G6iYzwOD6IXOUhzhNDlE2Y4vfHW6Exyz//BnEb mrwkRojulMY77ME7btOuho6jJvIOscibrikMVJ923eI/jvk/CUpx+OOA6wuhrezlNed7q9 5p8ijLr/Iw4EgmrgeWOCNkRGhl0zz6I= Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-35f236a563cso264481f8f.2 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=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=Aqecuk/j+cWcR1uWGatEcThGq+5RIRJx4qSyiIgAFX8=; b=g6H2CByYExst8/XKi+oJwviiJSspWKVp9Yv0+6qheaLm5Z5iUARc+vCQ8AVbPAU5YE RT426ahsIT1WmnmAp7boOEQJcC9KNSDlPvmOTm8gHePq9CEyBqhtu99Fhx1J5eY1wvBI bdHOR1Mfzx9Z/8B4cFmXHS+/xmfnXqTHZZbs/NjU3G3cGlaGKMz0lYcStaWeU0ZJzLLI 3dgOF49T63XJcxW2oMRFhSJDVDuqk8anPGx8tTfP3XMXa3xei+GS5wt+59cuIKQJmizb Y0jCGFBFJNLmQzR39fOCNeje2Y96V+6J3/gi0AHN2JUJfQl+ajMlF94FDtKw2eUlDIiP deNw== 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=nYl/AqgHBszkJ42W2i3e+dwFxw2PimRPUWvHx5jDvTLN+9hohbaKJyEGB/JkZHTH6a 5SJQFtL6OMxhbNwKYZCeJURIIyAqkflM5E7d48ms6VIK0xshJRXxRfXLYyL2MDOgvR3f X4he0zJIzhpHqXnfmtnt77mFIS3ogvHrtyyDqQHC0FiVVl2mboCfNZoCzafFbMpspC+X 3vE49lGWWC9rRxhtf2liwP+wqQOGrRyDrJn6yZWa/EBM3cuPNlDw8JEwYvC6VNjHOknx fRPcrxb3cju4lHWvg2JyxDmBTYVztZttLIq+U7FFBPKdV/Lyz68nz5YNh04o1NhKb4tW Kfpg== X-Forwarded-Encrypted: i=1; AJvYcCX0MbyipmovXKoy+6TjO4evUhqUFlN467AWTHUNRpPtkbuaujq/BE/k/uTGczhe7mzOLlMM7R9i+2u3U38fUbrwWfg= X-Gm-Message-State: AOJu0Yx4V3DFpzPiorA1aVslbXkLTvvY7vCyND8mlY77zwCil7m4Dzcw Il7jKd8fIum0AdjUQQSvPbSyuAmji9kItv0vpRtlqmn/qxXY+5VJqGYMR8VU0yE= X-Google-Smtp-Source: AGHT+IEPW9YFcQ2VxHIOQv4sUvLowLBf5ILbQcop/NQ40oDtk2hX5iHMJ7fOb4sgyat3imPvhg5Q1g== 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> MIME-Version: 1.0 X-Stat-Signature: aauziwdwjtcz4pmthd7jetxgwemy45dc X-Rspamd-Queue-Id: D3FD040018 X-Rspamd-Server: rspam04 X-Rspam-User: X-HE-Tag: 1718047225-135399 X-HE-Meta: U2FsdGVkX1/9P+i+3EaPazo5WEXCNyZ2PbnfW4NXVTzKV066rId7JytL4tk4m4xaTsNTL7HAwcMN38v0j1r0QRCzYcY+My+isEq4LLOnumQCLyMTOmIutYVSZZJngdDcPLSv7nEJFz/+zJtveY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vmbjDyGGC3vXePs3c3u6OVBKxRL+0BFtWsiqsEOANt9r0a9O7ZKAb6HKRJBRhcZqR5XwhRQGIBxU0durWeb8lnd+8oNlOTNDgZmT4cMNRHo674rsni1LOzvYR6YXN91+EATES4o2D6YujzNoGp9Zeeg2CPdoiIzE8B4C+8OiANTlcsC+nsTbKHMW29jKSPh0Ej X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, 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) 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); }