From mboxrd@z Thu Jan 1 00:00:00 1970 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 251CE254B0A; Thu, 17 Apr 2025 17:45:16 +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=1744911917; cv=none; b=jh6tuXRKv+I7xzF2Rz5j8l/2Go3T5and40kz0873xzuXU2kGmEegA0jHrKkJJ+HQ7vUqu7rhusVtkfmyKHulxZdk0g2t0mRWA4McLbWHxWjR6GaEBatJcrjuPVacL7Z50UlgxAFNj4q06h64P1q3QOUfYcAJ9QsICTeIQEub9eU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744911917; c=relaxed/simple; bh=6HqrhZNro99W4hlfSawIZ3bq362Egs1uCP6Vd2PPZEo=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=OkbEq+zcM/xf1fh8GVq2ck5w8tNC/4wmvXtyecxTZwo8xP3SoaIRhCITRGhlfqRsd3yrTctczb/TSZp+cnOVXgHix11HYE8GvK4ChylLAkXUjPBPz/jsTF3tJFocvqG7UZDw+ZTuN80s5zS5mZ4YJF7EbnAKfZ4ZuN/ZkmrAlAk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Rg9yC7Ql; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Rg9yC7Ql" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87272C4CEE4; Thu, 17 Apr 2025 17:45:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1744911916; bh=6HqrhZNro99W4hlfSawIZ3bq362Egs1uCP6Vd2PPZEo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Rg9yC7QlGIMHPKQ7WEUGcSXGLVG9wxf2u/ZQSNnkgiCyTxtBSESRPGDe+sRSX9zqE Yr6zKteWNfT21eUPrDzH3townbAbp+JNZoqjO8E9Btki0TkxaaNjeqnOFomOXxGsY9 npxcqlAvOCfIOhiGpE7+KHL4yZ17Ea7yhnR7iLd/LuMwKNgaMfatKUoXU++iSE+yc4 bCUeuLNT8zmRwNmWOd81ph5gMXXeKiDDW6+RZvyzte4ueYT3Dt2CGTpkNowMW9fKmZ kSD+ATjwqop+j6mDFplMVngOWwDoWMPy9UNGDtf1OWVrt4ZVExz07i9a69OinfacJU FCAJM3b+Ersgw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1u5TIY-006VUB-5A; Thu, 17 Apr 2025 18:45:14 +0100 Date: Thu, 17 Apr 2025 18:45:12 +0100 Message-ID: <86mscek7h3.wl-maz@kernel.org> From: Marc Zyngier To: Andrew Lunn Cc: Luo Jie , Yury Norov , Rasmus Villemoes , Julia Lawall , Nicolas Palix , Catalin Marinas , Will Deacon , Oliver Upton , Joey Gouly , Suzuki K Poulose , Zenghui Yu , linux-kernel@vger.kernel.org, cocci@inria.fr, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, quic_kkumarcs@quicinc.com, quic_linchen@quicinc.com, quic_leiwei@quicinc.com, quic_suruchia@quicinc.com, quic_pavir@quicinc.com Subject: Re: [PATCH v3 0/6] Add FIELD_MODIFY() helper In-Reply-To: <0c97c659-bd28-45e0-8537-d9be2637cb22@lunn.ch> References: <20250417-field_modify-v3-0-6f7992aafcb7@quicinc.com> <86sem7jb5t.wl-maz@kernel.org> <0c97c659-bd28-45e0-8537-d9be2637cb22@lunn.ch> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: andrew@lunn.ch, quic_luoj@quicinc.com, yury.norov@gmail.com, linux@rasmusvillemoes.dk, Julia.Lawall@inria.fr, nicolas.palix@imag.fr, catalin.marinas@arm.com, will@kernel.org, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, linux-kernel@vger.kernel.org, cocci@inria.fr, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, quic_kkumarcs@quicinc.com, quic_linchen@quicinc.com, quic_leiwei@quicinc.com, quic_suruchia@quicinc.com, quic_pavir@quicinc.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Thu, 17 Apr 2025 18:22:29 +0100, Andrew Lunn wrote: > > On Thu, Apr 17, 2025 at 12:10:54PM +0100, Marc Zyngier wrote: > > On Thu, 17 Apr 2025 11:47:07 +0100, > > Luo Jie wrote: > > > > > > Add the helper FIELD_MODIFY() to the FIELD_XXX family of bitfield > > > macros. It is functionally similar as xxx_replace_bits(), but adds > > > the compile time checking to catch incorrect parameter type errors. > > > > > > This series also converts the four instances of opencoded FIELD_MODIFY() > > > that are found in the core kernel files, to instead use the new > > > FIELD_MODIFY() macro. This is achieved with Coccinelle, by adding > > > the script field_modify.cocci. > > > > > > The changes are validated on IPQ9574 SoC which uses ARM64 architecture. > > > > We already have the *_replace_bits() functions (see > > include/linux/bitfield.h). > > > > Why do we need extra helpers? > > If you look at bitfield.h, the *_replace_bits() seem to be > undocumented internal macro magic, not something you are expected to > use. What you are expected to use in that file is however well > documented. The macro magic also means that cross referencing tools > don't find them. $ git grep _replace_bits| wc -l 1514 I think a bunch of people have found them, tooling notwithstanding. As for the documentation, the commit message in 00b0c9b82663ac would be advantageously promoted to full-fledged kernel-doc. Thanks, M. -- Without deviation from the norm, progress is not possible.