From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Marcelo Machado Lage <marcelomlage@usp.br>
Cc: jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com,
andy@kernel.org, Vinicius Lira <vinilira@usp.br>,
linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: adc: mcp3422: write bit operations with bitfield macros
Date: Fri, 17 Apr 2026 11:29:36 +0300 [thread overview]
Message-ID: <aeHvcCcQ1Xv5PuiC@ashevche-desk.local> (raw)
In-Reply-To: <20260417005041.484742-1-marcelomlage@usp.br>
On Thu, Apr 16, 2026 at 09:50:40PM -0300, Marcelo Machado Lage wrote:
> Replace manual bit manipulations with GENMASK(), FIELD_GET(),
> FIELD_PREP() and FIELD_MODIFY() calls. The resulting code is more
> readable and maintainable, and some macros previously defined in the
> header are not needed anymore.
...
> -#define MCP3422_CHANNEL_MASK 0x60
> -#define MCP3422_PGA_MASK 0x03
> -#define MCP3422_SRATE_MASK 0x0C
> +#define MCP3422_CHANNEL_MASK GENMASK(6, 5)
> +#define MCP3422_PGA_MASK GENMASK(1, 0)
> +#define MCP3422_SRATE_MASK GENMASK(3, 2)
Please, split this change and also add now missing bits.h
(bitfield.h doesn't cover it).
While doing that, convert all eligible constants.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-04-17 8:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 0:50 [PATCH] iio: adc: mcp3422: write bit operations with bitfield macros Marcelo Machado Lage
2026-04-17 8:29 ` Andy Shevchenko [this message]
2026-04-17 13:26 ` Jonathan Cameron
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=aeHvcCcQ1Xv5PuiC@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=marcelomlage@usp.br \
--cc=nuno.sa@analog.com \
--cc=vinilira@usp.br \
/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