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 8F8492BB17; Mon, 29 Sep 2025 20:26:04 +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=1759177564; cv=none; b=j3zcx5CEPdXnDcYLJqbN/WYpNykkuH0pLqkSDLkdYAlJ/dGX1bMpRI2gWqoWrSki13c9eEijK6tVBS8IdvtTsnsryTprXEB9DI0fI2MdSuiKfSzybxh7g/hZ/5bYFkh59vQMYTxYL9q6Y1kdtHJBhbdE47srUSxT9b4WzH94nck= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759177564; c=relaxed/simple; bh=g3SiTYjVTxCd0bvy26AS//Wa/hjyLJSQCblqZEbFsN8=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=JUpD8Z1iOcv4JwwYQiC2xq8YF3e6gIv1cmT7coQMNiXvXlyM9eKeEY4ABr+U62F9/PCIjQomRQ9bAz7NHBVTAK/MmzPWe/OdEv6eOfnyjPsS+cfi2fLJ2et4Pm0DMlVYhznvAv54MSWwLvscWH/tkxQTimZU04onlPaoW25V2LM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qAraSubB; 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="qAraSubB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11619C4CEF4; Mon, 29 Sep 2025 20:25:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1759177564; bh=g3SiTYjVTxCd0bvy26AS//Wa/hjyLJSQCblqZEbFsN8=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=qAraSubBaP3G53iNyUq2zgaBdRPkblRFx37CeccjQlPbxLoWUf3X7Ge3LGaoKkqVc aFtw7jFkNg8mTsfRRol8c9o8Vq+jQpPl8hzCM21g2r0QjY7AOvb8LPuX2x46bzF5DV 7GFz8Fq5byzL3g7CHVgJhOaYeXBaCkBJiwjc495jCx7HNoMvXFnDtinXBJZftZ31tx Lup7AYuzTo6qECaTwqgVDiBu53M2ZHBbOIJ2HDEepfxjt6Z/uQX/yuhleiBNhlHcYR MCodxsexUBnSMLY1zpyRsPMELKHEdksPf7I9sjaicOYYAgBedPXsnJumDpd9+1g/2J 98foxi5GJNaTg== Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 29 Sep 2025 22:25:57 +0200 Message-Id: Subject: Re: [PATCH v4 1/6] nova-core: bitfield: Move bitfield-specific code from register! into new macro Cc: "Greg KH" , "Benno Lossin" , , , , , "Alistair Popple" , "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "David Airlie" , "Simona Vetter" , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "John Hubbard" , "Timur Tabi" , , "Elle Rhumsaa" , "Yury Norov" , "Daniel Almeida" , To: "Joel Fernandes" From: "Danilo Krummrich" References: <20250920182232.2095101-1-joelagnelf@nvidia.com> <20250920182232.2095101-2-joelagnelf@nvidia.com> <2025092157-pauper-snap-aad1@gregkh> <2025092125-urban-muppet-1c2f@gregkh> <20250923222434.GA2479829@joelbox2> <2025092425-sinuous-playoff-3618@gregkh> <76f87707-17d8-4cb0-8c81-e67ebf62984a@nvidia.com> In-Reply-To: <76f87707-17d8-4cb0-8c81-e67ebf62984a@nvidia.com> On Mon Sep 29, 2025 at 9:26 PM CEST, Joel Fernandes wrote: > On 9/24/2025 12:40 PM, Greg KH wrote: >> On Tue, Sep 23, 2025 at 06:24:34PM -0400, Joel Fernandes wrote: > [..] >>=20 >>> For the separate issue of enforcing endianness with respect to (across) >>> multiple fields, I agree with you that if the user's backend (the consu= mer of >>> the data) is not doing such conversion, say via regmap, then that becom= es a >>> problem. But that problem is orthogonal/different and cannot be solved = here. =20 >>=20 >> But that is exactly what these macros are being defined here for, so to >> ignore that is going to cause problems :) >>=20 > > If needed, happy to add endianness support as needed by providing additio= nal > options to the macro. Based on this thread, it sounds like we want see if= that > is really needed here or can be solved elsewhere (?). The mental model I = kind of > have is this macro should only be dealing with CPU native endianness, muc= h like > bitfields in C deal with CPU endianness. Hmm. At least for register!() we don't need anything else than CPU endianness. I= n fact, as described in [1], any representation is fine as long as it is consistent. [1] https://lore.kernel.org/all/DD0ZTZM8S84H.1YDWSY7DF14LM@kernel.org/