From patchwork Fri Jul 1 12:54:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 12903266 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1B47DC43334 for ; Fri, 1 Jul 2022 12:56:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UY9bse7MZb4qU+i/2kRqGkAYGv1huiKI+QLsO4hPKIo=; b=BiLsChC3hI4WSF 7AJnEFGEmjeW83OCPTlD7KzqP7P6rjHv2wDLT9DgTHOAeNM4lBYnq8MjcZOQSxOIzvH+fXU6tiuIe x4jT4hP80+dAxsVsNOdkxAxd0iC5Gp0a0a/ePIGnmUBOv4DSL+6IOEW8mUPnWQtS2n1AHvqChyRrx BiPfTzKXzlVGhk/ZU1RVQbIv6IO1Eyh+EkDdbHvEdn1KyuAseT43JiKb85j3OqAdi6Kt34pYqQq8u 2pAU/fp8VoOm7wldu2OVmulFNSNRCkDt+2Ua06SA2wpXi85igJfb+Dl5bt8CU5CHF3p16eS3IyGzI A5xRLvYVpXG6+CUFIrAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7GBC-004rwh-5l; Fri, 01 Jul 2022 12:55:26 +0000 Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7GAU-004rZR-7u for linux-arm-kernel@lists.infradead.org; Fri, 01 Jul 2022 12:54:45 +0000 Received: by mail-qt1-x836.google.com with SMTP id x1so316902qtv.8 for ; Fri, 01 Jul 2022 05:54:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JCJEdfzYxuANLNWAxL8CQ7FpG0f6ZAq5X4D5qi7db0c=; b=ookWblnG18DUulKFRrux/M2omlEfLyyUcepuZnHv4ZaA1RBHkzX+bnWjddFRVYrGqW MZK3N6pQJ+6xAKJnSgmW2LyplfSQHvIKMQFTtXWVg5XwyxKw0BUV+064ooiigTWFTQM3 oRjpThV6MgTWGHYTkIsd347Nm4AugejfecG4jQi3rx9RxD3Gv93MikthDtQMo5P22QoV aNX9/wgVJX7yI+/KAm8xGXjPjzNlYfKCKED+nNW8Hdgp607nMK6Xh1D8dVUV25sNNnr3 HAl4/p/qRptBefuSAQQ7YWgZkQK47yR/xtzFtfxk1KXe7aowBiZV7dy//1nGwbflyE6Y Qu3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JCJEdfzYxuANLNWAxL8CQ7FpG0f6ZAq5X4D5qi7db0c=; b=aOuz0qSmxPH1WMH1rlZ98iTzCvkQSitj6B+u13iidPxcdmAQVk5r9lanfAHO+q5py+ +XUhbfS4vLtzsZafCUcuAKWmDw6qXp8eAgk7DK1o/Re0Yp8ooZBpt4LaGWWHJH61jiw/ a5jRQrclJpur9lHVxttm6ZqoZ+HumBkxmEJ8NiaU5/ZGN498A18zgQdyzh92NLBB+ofU l3dSOJ3PYWTnrC4KDmS3t2g9s0MrkwzTxDIVfbOgl/P6xcH6isqh4Ifd2OAkYXqE1yAV eiOqE44/DwNwTRNb9jg0FHRQQM4t08GxxQZzNoYKtZqZ/RR3AImhLjz6LFU9lTSAL1h7 kIuQ== X-Gm-Message-State: AJIora8lwLjE/gKb0QUSCQeIFYnTNHBmRmH6ZoOsCxu7giAyVxqIdHSa kMW4+P7DVxwBMNGYRoN4T/c= X-Google-Smtp-Source: AGRyM1uv2u+hxNkph56Thb2L3PJG6Sax4s9QHwbWNS6xD+og2wEgeS7yy6MYcj8u15wxE3ny3uoT6w== X-Received: by 2002:a05:622a:54b:b0:305:31e4:51fa with SMTP id m11-20020a05622a054b00b0030531e451famr12451035qtx.165.1656680078441; Fri, 01 Jul 2022 05:54:38 -0700 (PDT) Received: from localhost ([2601:4c1:c100:1230:f902:9816:653f:2f66]) by smtp.gmail.com with ESMTPSA id x5-20020a05620a448500b006a6d4261f40sm1088206qkp.111.2022.07.01.05.54.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 05:54:38 -0700 (PDT) From: Yury Norov To: linux-kernel@vger.kernel.org, Andrew Morton , Andy Shevchenko , David Howells , Geert Uytterhoeven , Jonathan Corbet , "Kirill A . Shutemov" , Matthew Wilcox , NeilBrown , Rasmus Villemoes , Russell King , Vlastimil Babka , William Kucharski , linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org Cc: Yury Norov Subject: [PATCH 4/8] cpumask: change return types to bool where appropriate Date: Fri, 1 Jul 2022 05:54:26 -0700 Message-Id: <20220701125430.2907638-5-yury.norov@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220701125430.2907638-1-yury.norov@gmail.com> References: <20220701125430.2907638-1-yury.norov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220701_055442_395488_8D486DDA X-CRM114-Status: GOOD ( 12.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Some cpumask functions have integer return types where return values are naturally booleans. Signed-off-by: Yury Norov --- include/linux/cpumask.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index fe29ac7cc469..b54e27d9da6b 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -372,9 +372,9 @@ static __always_inline void __cpumask_clear_cpu(int cpu, struct cpumask *dstp) * @cpu: cpu number (< nr_cpu_ids) * @cpumask: the cpumask pointer * - * Returns 1 if @cpu is set in @cpumask, else returns 0 + * Returns true if @cpu is set in @cpumask, else returns false */ -static __always_inline int cpumask_test_cpu(int cpu, const struct cpumask *cpumask) +static __always_inline bool cpumask_test_cpu(int cpu, const struct cpumask *cpumask) { return test_bit(cpumask_check(cpu), cpumask_bits((cpumask))); } @@ -384,11 +384,11 @@ static __always_inline int cpumask_test_cpu(int cpu, const struct cpumask *cpuma * @cpu: cpu number (< nr_cpu_ids) * @cpumask: the cpumask pointer * - * Returns 1 if @cpu is set in old bitmap of @cpumask, else returns 0 + * Returns true if @cpu is set in old bitmap of @cpumask, else returns false * * test_and_set_bit wrapper for cpumasks. */ -static __always_inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask) +static __always_inline bool cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask) { return test_and_set_bit(cpumask_check(cpu), cpumask_bits(cpumask)); } @@ -398,11 +398,11 @@ static __always_inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpu * @cpu: cpu number (< nr_cpu_ids) * @cpumask: the cpumask pointer * - * Returns 1 if @cpu is set in old bitmap of @cpumask, else returns 0 + * Returns true if @cpu is set in old bitmap of @cpumask, else returns false * * test_and_clear_bit wrapper for cpumasks. */ -static __always_inline int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask) +static __always_inline bool cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask) { return test_and_clear_bit(cpumask_check(cpu), cpumask_bits(cpumask)); } @@ -431,9 +431,9 @@ static inline void cpumask_clear(struct cpumask *dstp) * @src1p: the first input * @src2p: the second input * - * If *@dstp is empty, returns 0, else returns 1 + * If *@dstp is empty, returns false, else returns true */ -static inline int cpumask_and(struct cpumask *dstp, +static inline bool cpumask_and(struct cpumask *dstp, const struct cpumask *src1p, const struct cpumask *src2p) { @@ -474,9 +474,9 @@ static inline void cpumask_xor(struct cpumask *dstp, * @src1p: the first input * @src2p: the second input * - * If *@dstp is empty, returns 0, else returns 1 + * If *@dstp is empty, returns false, else returns true */ -static inline int cpumask_andnot(struct cpumask *dstp, +static inline bool cpumask_andnot(struct cpumask *dstp, const struct cpumask *src1p, const struct cpumask *src2p) { @@ -539,9 +539,9 @@ static inline bool cpumask_intersects(const struct cpumask *src1p, * @src1p: the first input * @src2p: the second input * - * Returns 1 if *@src1p is a subset of *@src2p, else returns 0 + * Returns true if *@src1p is a subset of *@src2p, else returns false */ -static inline int cpumask_subset(const struct cpumask *src1p, +static inline bool cpumask_subset(const struct cpumask *src1p, const struct cpumask *src2p) { return bitmap_subset(cpumask_bits(src1p), cpumask_bits(src2p),