From: Johannes Berg <johannes@sipsolutions.net>
To: William Breathitt Gray <william.gray@linaro.org>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Cc: Jonathan Cameron <jic23@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/4] bitfield: Introduce the FIELD_MODIFY() macro
Date: Mon, 20 Mar 2023 09:50:35 +0100 [thread overview]
Message-ID: <7cd746c7b585c5086cfbd9db22414a060356cdd8.camel@sipsolutions.net> (raw)
In-Reply-To: <1c1492558c1a72b64bb26f7a44c4e69fff0e6b44.1679149543.git.william.gray@linaro.org>
On Sat, 2023-03-18 at 14:59 +0000, William Breathitt Gray wrote:
> It is a common code pattern to modify a bitfield by masking the field
> and performing a bitwise OR with the respective FIELD_PREP. Wrap such a
> task into a macro by introducing FIELD_MODIFY() which modifies the field
> specified by a mask from a bitfield by putting a val in the field.
So I have no objection to adding this and you using FIELD_* macros, but
just wanted to say that personally I've come to prefer the typed
versions declared later in the fiel, and there we have
<type>_replace_bits() already.
Hmm. And now that I mentioned that, maybe that means FIELD_REPLACE()
would be nicer as a name?
johannes
next prev parent reply other threads:[~2023-03-20 8:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-18 14:59 [PATCH 0/4] Refactor 104-quad-8 to match device operations William Breathitt Gray
2023-03-18 14:59 ` [PATCH 1/4] counter: 104-quad-8: Utilize bitfield access macros William Breathitt Gray
2023-03-18 14:59 ` [PATCH 2/4] bitfield: Introduce the FIELD_MODIFY() macro William Breathitt Gray
2023-03-20 8:50 ` Johannes Berg [this message]
2023-03-20 12:22 ` Andy Shevchenko
2023-03-20 15:03 ` William Breathitt Gray
2023-03-18 14:59 ` [PATCH 3/4] counter: 104-quad-8: Refactor to buffer states for CMR, IOR, and IDR William Breathitt Gray
2023-03-18 14:59 ` [PATCH 4/4] counter: 104-quad-8: Utilize helper functions to handle PR, FLAG and PSC William Breathitt Gray
2023-03-20 12:28 ` Andy Shevchenko
2023-03-20 15:31 ` William Breathitt Gray
2023-03-20 15:36 ` Andy Shevchenko
2023-03-20 15:53 ` William Breathitt Gray
2023-03-20 16:54 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7cd746c7b585c5086cfbd9db22414a060356cdd8.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=william.gray@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox