Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp191103lqb; Tue, 4 Jun 2024 08:38:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXwDGP4UkGTTPBeIv7ZcUAEaaIQxP/SKXxRJO3cdlW1X6OrcxcClZ15c0CNo5rEsvjrxAezn2uC3TfqwUgUMMhx2glRrO27uxk7ZlXn2w== X-Google-Smtp-Source: AGHT+IEIg4oGsDMWMjWhWgjiarX8KzePTgkM7ugxsaLaBV+YCfOO6JzylR5Qa99n9PHx1nFYoiQB X-Received: by 2002:a50:c8cd:0:b0:579:cee1:9139 with SMTP id 4fb4d7f45d1cf-57a365b2bccmr9168736a12.28.1717515518642; Tue, 04 Jun 2024 08:38:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717515518; cv=pass; d=google.com; s=arc-20160816; b=xGnixXAB1LbFZ3HWvPRMWuVAjo9K3WNXMDcW9y0Nki1AaY9ZvV9BykdgDyD/Sv1Hll s5hg6WSKT/0V13P7CXZHS2P932qd/21ONhbf+DjCm0dAkrOR24AONxHTCIEAJ7Spru2Z 5F/3Q0Rlx4SkOavt5peEiEKDDrCe6FYS2fpir+vh5IuabOYkwf+jjkkTJd6VzovG/thc kMcerEvHBs4LdJe9VJ8R8dF2L3Tr3CFf/mkMfpcQ3SrAdqdjE5A0D4829YQq6xHhahvO 3nKxNVdgeLcpDEnGI80G/fsoyVEF+eT7ErdSRd9OaQ9HrWjq3Dq1G0fxyZPR2MR8l8W1 Pb5Q== 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 :subject:cc:to:from:date; bh=4CMTw8e/CZuzZa1zxczlUO7dYi2zP8A0pIKwzELVD7A=; fh=AHZfrLiQkgyjMNC/VMQvQkLtpUeaw/3PHe5Ni96qoXc=; b=lFxixmLgCqUU28/m8Eqx32Sy+/ClnU/j5+9Y8QoZ5SQqisjRu3dKxbeLT7QRdQRyGM 8t4KVjn0GqWHBXUZ56lA1o6R3uFt7Royfn3SjC+AnWP9kHAaVkInhmutYNrtjiY+Q7lk +Rp0dK2ttBxOe3SX70SEQov1WpvBgC5rO4kCmt274qP7s4/8PEnGSfKI3QS0txcBN3xQ HNd1HRc34kFtSkzDED2rLGkx/F3fJcBrablIn9VN2EfXvRca0mPTWZEARdWnmxgH4WeM W9UmfCZ9IbEh8IJRplS+wWXsTBAsKaEh7k7knBkhoXAhfjEXxkT/0ZKE1bjG0c12jfZy Kibw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-200946-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200946-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 4fb4d7f45d1cf-57a31ca5a8dsi5273826a12.519.2024.06.04.08.38.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 08:38:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-200946-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; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-200946-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-200946-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 B3ED91F21D50 for ; Tue, 4 Jun 2024 15:28:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 43781145333; Tue, 4 Jun 2024 15:28:03 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6D4B143C7A; Tue, 4 Jun 2024 15:28:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717514882; cv=none; b=SMzwzBJxqgEluhcMUIhx7o7Xmj3NqLfpVuK9qvGvWue2Enr6phJkJgG7ccdxvL0t2p+ZNwvE1uJOHBhSuplRLG6DSaq5pMKZNEmWxMyq9Vo1vBetBkfeT976DGPFRMU/9g/PgEG5bOEDjJbk50n0szS/US257UacI8jupNI0cT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717514882; c=relaxed/simple; bh=N7rt7381fj96UTAPC9MEjjfA0I4AkNKWgkWWPbMyq44=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Egk1CRfM0QvaEWx9Dlr5mhzRvAQ7p0dTYNd/2qURYYdciJNhXIS2SkV4fhSR5wDqWs2An+sQcGOsWc9usOsrjaTMWO5Husc4uWRvEN6rH/c7JvZ2BRyiMgio9+0CGcfiKEjB4wdlRNhr1FiNlg8uuT1SUuGjkaqhIMF87Welf9g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30859C4AF07; Tue, 4 Jun 2024 15:28:00 +0000 (UTC) Date: Tue, 4 Jun 2024 11:27:59 -0400 From: Steven Rostedt To: Metin Kaya Cc: Qais Yousef , Ingo Molnar , Peter Zijlstra , Juri Lelli , 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 Subject: Re: [PATCH v4 2/2] sched/rt, dl: Convert functions to return bool Message-ID: <20240604112759.56b9394c@gandalf.local.home> In-Reply-To: <417b39d1-8de8-4234-92dc-f1ef5fd95da7@arm.com> References: <20240601213309.1262206-1-qyousef@layalina.io> <20240601213309.1262206-3-qyousef@layalina.io> <417b39d1-8de8-4234-92dc-f1ef5fd95da7@arm.com> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 3 Jun 2024 08:33:53 +0100 Metin Kaya wrote: > On 01/06/2024 10:33 pm, Qais Yousef wrote: > > {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; > > Nit: `return unlikely(prio < MAX_DL_PRIO)` would be simpler. > The same can be applied to rt_prio() and realtime_prio(). This would > make {dl, rt, realtime}_task() single-liner. Maybe further > simplification can be done. Agreed. -- Steve