Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp592939rdh; Wed, 14 Feb 2024 06:12:55 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWYZHpYMy5zjEnFGxFNdkrq2nTC3eUEeJ0xinUYYnlwbQB2YX6fLIhWK3WSYccIS6Fz9Hc9idovDcnfULvN/wEra7gN3PZJwO65C0M70w== X-Google-Smtp-Source: AGHT+IEsf6hjNcaInEWiqi8NTkdN/I6FCb9RT7QJ+hMPso/ypq79Tk+qIO8EEq4IA91ny5lR7Ovi X-Received: by 2002:a50:fb0d:0:b0:560:5078:3307 with SMTP id d13-20020a50fb0d000000b0056050783307mr1877587edq.13.1707919975519; Wed, 14 Feb 2024 06:12:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707919975; cv=pass; d=google.com; s=arc-20160816; b=f8BOLKH0DEemrPisohGU3Fy6OkrYpVtd1PVRX5us1mGNi6TtbLS/U5yAKr9/KoQBR7 OrjdEEvEE0brJ4cfPJK4Eh1srx2ZgdV8pEMGzrf0n1Qx00WASUR2k1mPvpchlsgJBdRA 7b+BA2QRgcXZ3wiaiY/Hb24OfuGPJyDSRIpI7K+r8c4i7HuTYXO8ERh2J+ZVV1m7g2Z7 WleAuRvOxIHjwYE1t5lofGAGyVY9g27GHhmorXoVDKpA/agYBHtn+ZahVd2iweia19bB 55d4xIVmXeESJiz7aQjn7iWLh+E9qw3LE1TSrY5HvhhlAGPuFTRk7JuLqD5TGR+48QC8 NRlA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=u0kIpSAb05zkB3fbg/RdkoUC9lGMutEwWttdx+EgEDY=; fh=kUpyrW781pP4UkyIkIpfFLM3TnTJEW00dHUQt475iJI=; b=cp5mcTCYzjF7eqMNL90CFErDVAQqMFEnTRhoWt3EIHtbXUntq6qOOcznokKQdHYX5/ rGLldwIxHpQOoIptbholi/ogAhkcXT28W3gLd2soMQtw9YV859K/IHeoST/0XOqT8+5D bpqsHxLQLIxM4KBLHFcPxuxzu7TW9TIqmlO6R0xp8Sz+Cmtzs2CCSc/W2ZIZ3a/sU1oD p7pkk/2z7FJcnJXCWRkPgiHZgTAjvEHRLG2RhATPJew95IaHN8GYtFl+wQAnsFus6Y52 F7RiGId3pH/z1526Zpm6F5tye+xYC4DpozBba14Gsx8v9FbfCwRjNoXL52ZNfGtKJQbD nwjw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-65322-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65322-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=2; AJvYcCUXbQxfELGLX30+1Hw9SFNYCjJo3gWfTxzz6ldCnAU6zOTZoAY4I8Tw4gRtSZKMyqf4HJB6zD81H/rjj6/pQujszHPvZF8Q9FjB5+ZP4w== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id df13-20020a05640230ad00b00563919b3b9csi120190edb.220.2024.02.14.06.12.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 06:12:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65322-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 spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-65322-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65322-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 6AD4B1F27A69 for ; Wed, 14 Feb 2024 14:12:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC4F354FB6; Wed, 14 Feb 2024 14:12:29 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 29C7B54BD9 for ; Wed, 14 Feb 2024 14:12:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707919949; cv=none; b=eFY27tFdTFDrlv3A+I7Gn3jZdmtiFGrdNVn4pEFCdVAqScvsVbqePE9jzYcmJJOgsCZGHdkC21kToZDKWm9kmnWfMiKkBe0wuZCxlDxP1EpJ2wUnq/o1jh8/4pK5cFtU2eKgrh+TVchjdaugAilydVTcuMawN1OoVdM8ZiLtNTI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707919949; c=relaxed/simple; bh=DjL3TuX2F7s/3sIGHVw41gv2i6azOAQmF5jfG+IBnf8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oytuxvtLZ0Ke9vIMR8x+ZlvxXrTjDtVguvn6dVt+p3pX6y7YQenptTawA+aEwEEaWDrl19/JYdKOUCbkO+eYSTrcAKhqckS8XGUgeWIHIobCLa+Kf48o99xKoiuSfTTkUO9yvUUQKmh8tFiwqAfb7mbFdITwdj0RhLvkZ/aHX3Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 74CA41FB; Wed, 14 Feb 2024 06:13:06 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.64.145]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 47C953F5A1; Wed, 14 Feb 2024 06:12:20 -0800 (PST) Date: Wed, 14 Feb 2024 14:12:17 +0000 From: Mark Rutland To: Ankur Arora Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org, torvalds@linux-foundation.org, paulmck@kernel.org, akpm@linux-foundation.org, luto@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, willy@infradead.org, mgorman@suse.de, jpoimboe@kernel.org, jgross@suse.com, andrew.cooper3@citrix.com, bristot@kernel.org, mathieu.desnoyers@efficios.com, geert@linux-m68k.org, glaubitz@physik.fu-berlin.de, anton.ivanov@cambridgegreys.com, mattst88@gmail.com, krypton@ulrich-teichert.org, rostedt@goodmis.org, David.Laight@aculab.com, richard@nod.at, mjguzik@gmail.com, jon.grimm@amd.com, bharata@amd.com, raghavendra.kt@amd.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: Re: [PATCH 04/30] sched: make test_*_tsk_thread_flag() return bool Message-ID: References: <20240213055554.1802415-1-ankur.a.arora@oracle.com> <20240213055554.1802415-5-ankur.a.arora@oracle.com> 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-Disposition: inline In-Reply-To: <20240213055554.1802415-5-ankur.a.arora@oracle.com> On Mon, Feb 12, 2024 at 09:55:28PM -0800, Ankur Arora wrote: > All users of test_*_tsk_thread_flag() treat the result as boolean. > This is also true for the underlying test_and_*_bit() operations. > > Change the return type to bool. > > Cc: Peter Ziljstra > Originally-by: Thomas Gleixner > Link: https://lore.kernel.org/lkml/87jzshhexi.ffs@tglx/ > Signed-off-by: Ankur Arora Acked-by: Mark Rutland I think this makes sense on its own regardless of the rest of the series; it might make sense to move it to the start of the series so that it can easily be picked up even if the rest needs work. Mark. > --- > include/linux/sched.h | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/include/linux/sched.h b/include/linux/sched.h > index 7a22a56350bb..e790860d89c3 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -1933,17 +1933,17 @@ static inline void update_tsk_thread_flag(struct task_struct *tsk, int flag, > update_ti_thread_flag(task_thread_info(tsk), flag, value); > } > > -static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag) > +static inline bool test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag) > { > return test_and_set_ti_thread_flag(task_thread_info(tsk), flag); > } > > -static inline int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag) > +static inline bool test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag) > { > return test_and_clear_ti_thread_flag(task_thread_info(tsk), flag); > } > > -static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag) > +static inline bool test_tsk_thread_flag(struct task_struct *tsk, int flag) > { > return test_ti_thread_flag(task_thread_info(tsk), flag); > } > @@ -1958,7 +1958,7 @@ static inline void clear_tsk_need_resched(struct task_struct *tsk) > clear_tsk_thread_flag(tsk,TIF_NEED_RESCHED); > } > > -static inline int test_tsk_need_resched(struct task_struct *tsk) > +static inline bool test_tsk_need_resched(struct task_struct *tsk) > { > return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); > } > -- > 2.31.1 >