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: 12903257 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 8B951C433EF for ; Fri, 1 Jul 2022 12:54:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 08A806B007D; Fri, 1 Jul 2022 08:54:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 00B846B007E; Fri, 1 Jul 2022 08:54:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D51B26B0080; Fri, 1 Jul 2022 08:54:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C276B6B007D for ; Fri, 1 Jul 2022 08:54:39 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 9EC50615B5 for ; Fri, 1 Jul 2022 12:54:39 +0000 (UTC) X-FDA: 79638525078.30.7190CEF Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) by imf21.hostedemail.com (Postfix) with ESMTP id 3479D1C0038 for ; Fri, 1 Jul 2022 12:54:39 +0000 (UTC) Received: by mail-qt1-f181.google.com with SMTP id h19so317496qtp.6 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=RPhObgBqp0jRB6XroQthwmRUWIiXtTp0M/im94PTsyJ7c/OqPRTB9MGQNkwaBSqbQW O5DtRU3GPmS+8P27kT+D7gx62Bn2HBwk3QY5ewV15bZLvXghlsbFCyJdcbgr65hiVZmm FiOYkL1akzSiwgsO/GbxL6edQvU2tYrPDQPnEHSwySXSF2le8O9TFgEWF/mfVzDtC/if AzCwC5WDpt9I/lgpjtc7psNCO9W7IhlvMFlkSSnc0L8RFQBNHig/wW91ygW3LFynWp2t KjietanP4JFz/KWmXWvmBjdAiQuByK4k/t6DbBaJs4YSgLJR+tiXxtOSSDpVj9pVZsjY 9amg== X-Gm-Message-State: AJIora+Sb4drd+CUtTWA5eMWQeqDgJtflGr6yEZ8QVDtdJDtcLpVBy82 69N8jFsEnu5joJyCfA39A54= 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656680079; 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=JCJEdfzYxuANLNWAxL8CQ7FpG0f6ZAq5X4D5qi7db0c=; b=4ewsulKWsWVJfOrWEfTi53Kl3GN/2NJFu1qFLLXqvb7AwfQU1RDrR5uNUFKoufP/7CyYv0 8H3yH4tuWPy9ka72bHDx141Q5W11IUig/HjkaXi9VelISXLYJZnrpE7jMSE8lRYpWzdKEo FBMveZI/G26wTwXZ4Efw2pKnko9W53o= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656680079; a=rsa-sha256; cv=none; b=4kOUsD5p2ChQ9wegSFi5+ICVRADJ4nG97znlTK14mwZMuMyEAbnOFaWPCWeUFG5v319qI5 WaF/7gjo1AjX4uLpziifcnF/sdoYk9egaUqjyRU0ZEo3hqc7aYSizgCZ8ABSFxwwB8lCSu p9LiiVlImj7nRKNfBPOOI8KAYvHAx4s= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ookWblnG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf21.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.160.181 as permitted sender) smtp.mailfrom=yury.norov@gmail.com X-Stat-Signature: fgooircz3q8cwcxywmheehqkgo8wt3q9 X-Rspam-User: Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ookWblnG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf21.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.160.181 as permitted sender) smtp.mailfrom=yury.norov@gmail.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 3479D1C0038 X-HE-Tag: 1656680079-277128 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: 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),