From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 B634A19ABD8 for ; Sat, 30 May 2026 00:28:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780100888; cv=none; b=IuqAMxMPA9Bhs40oeFIWoE0vHg074sTEj4jbodmgfNx6DXzQ01WcvjxX5g5NMylaNo1CFda1lGD0dhoF4ckMwR3hGpnTrdTUXseQ4r3tIKbkhQG/yn6guL6eNjVa8H+NDNJ8/Ta2DmSO6F18ghasiwiyweWozkNuC9LzDyEViqA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780100888; c=relaxed/simple; bh=1hEd3j0H1dm2iw1sIKA1AH5jDv9fu0sW97XhSgd16Ds=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SGUxmRFArG2bvtBMO3EZIy0puGeD3CjWkTa5TfsEesYws1JYEsSAL5Lk8wyBglEmOCfIQ9/Jowm+HFq51z2oZ9iKlA8xB4Sagb4U9ffv80rKFsboa7iQv94P+udU++VqKRwRlH1aeuqdkTXXrfHstV2GftiNsow01FPmS/wd48s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=B9YP5sjw; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="B9YP5sjw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2FBE1F00893; Sat, 30 May 2026 00:28:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780100887; bh=05VuIf28x1kwUtDQQxztMZ5Dutlt/L3Du+VseyWwTYs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=B9YP5sjwCnpBB+zSHP5Z25aJX5n5GnNVmimq2ROR/HujPd5/3lU4JkGq0fVDunhll yW/5zdkc5utsLp130I6WWKQEH1hrMFa2VB1XiGWj69Pg6g2PGZOw9YkXfiqjM009/J wfm4OdbnkbGvZ4NbXRG50OG3U8o/PSw2Sent05iRogy5vzF48+0qVpn8XL2/nrp3T+ hzX/6Cv1BOyI277ip+rYOaZT552MAIPejqSI8pVN9sSMMqWSzvwBKuAiilPjVNwWAe Gl38eRoaHUfFNsEK+O7A8zQx/pQ0gu+AAFI681XDP6gojyIAQyqdv7FN0kXejRi+xe OBmzfJERHGl/Q== From: SeongJae Park To: Joshua Hahn Cc: SeongJae Park , Yury Norov , Rasmus Villemoes , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel-team@meta.com Subject: Re: [PATCH] mm/nodemask: Correctly describe nodemask operation return types Date: Fri, 29 May 2026 17:27:48 -0700 Message-ID: <20260530002749.87977-1-sj@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260529202755.1846800-1-joshua.hahnjy@gmail.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Fri, 29 May 2026 13:27:54 -0700 Joshua Hahn wrote: > Commit 0dfe54071d7c8 ("nodemask: Fix return values to be unsigned") > changed a number of nodemask operations that used to return int > to returning a bool instead. However, it did not update the comment > block that described these functions, leaving the documentation > incorrect. > > Fix the comment block to accurately describe the functions. > Also fix a typo (unsigend --> unsigned), and fix a callsite in > mempolicy.c that did not get updated during the conversion. Nice catch, thank you fixing this! > > No functional changes intended; changes are purely cosmetic. > > Signed-off-by: Joshua Hahn Reviewed-by: SeongJae Park > --- > include/linux/nodemask.h | 18 +++++++++--------- > mm/mempolicy.c | 2 +- > 2 files changed, 10 insertions(+), 10 deletions(-) > > diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h > index 204c92462f3c0..b842aa5255464 100644 > --- a/include/linux/nodemask.h > +++ b/include/linux/nodemask.h > @@ -24,23 +24,23 @@ > * void nodes_setall(mask) set all bits > * void nodes_clear(mask) clear all bits > * int node_isset(node, mask) true iff bit 'node' set in mask > - * int node_test_and_set(node, mask) test and set bit 'node' in mask > + * bool node_test_and_set(node, mask) test and set bit 'node' in mask > * > - * void nodes_and(dst, src1, src2) dst = src1 & src2 [intersection] > + * bool nodes_and(dst, src1, src2) dst = src1 & src2 [intersection] > * void nodes_or(dst, src1, src2) dst = src1 | src2 [union] > * void nodes_xor(dst, src1, src2) dst = src1 ^ src2 > - * void nodes_andnot(dst, src1, src2) dst = src1 & ~src2 > + * bool nodes_andnot(dst, src1, src2) dst = src1 & ~src2 > * void nodes_complement(dst, src) dst = ~src > * > - * int nodes_equal(mask1, mask2) Does mask1 == mask2? > - * int nodes_intersects(mask1, mask2) Do mask1 and mask2 intersect? > - * int nodes_subset(mask1, mask2) Is mask1 a subset of mask2? > - * int nodes_empty(mask) Is mask empty (no bits sets)? > - * int nodes_full(mask) Is mask full (all bits sets)? > + * bool nodes_equal(mask1, mask2) Does mask1 == mask2? > + * bool nodes_intersects(mask1, mask2) Do mask1 and mask2 intersect? > + * bool nodes_subset(mask1, mask2) Is mask1 a subset of mask2? > + * bool nodes_empty(mask) Is mask empty (no bits sets)? > + * bool nodes_full(mask) Is mask full (all bits sets)? > * int nodes_weight(mask) Hamming weight - number of set bits > * > * unsigned int first_node(mask) Number lowest set bit, or MAX_NUMNODES > - * unsigend int next_node(node, mask) Next node past 'node', or MAX_NUMNODES > + * unsigned int next_node(node, mask) Next node past 'node', or MAX_NUMNODES > * unsigned int next_node_in(node, mask) Next node past 'node', or wrap to first, > * or MAX_NUMNODES > * unsigned int first_unset_node(mask) First node not set in mask, or I feel like this comment block might be easy to be outdated in future. This comment block is introduced before the git era. I think this was the best and great way at that time. But now we have modern documentation tools like kernel-doc. I'm wondering if it makes sense to convert this comment block to kernel-doc comments in long term, after this patch is merged. If we sure these APIs are quite stable and expect no many changes in future, such conversion may not make sense, though. Thanks, SJ [...]