From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Marcelo Machado Lage <marcelomlage@usp.br>, y@ashevche-desk.local
Cc: andy@kernel.org, dlechner@baylibre.com, jic23@kernel.org,
nuno.sa@analog.com, Vinicius Lira <vinilira@usp.br>,
linux-iio@vger.kernel.org
Subject: Re: [PATCH v2 2/2] iio: adc: mcp3422: write bit operations with bitfield macros
Date: Sat, 18 Apr 2026 03:34:07 +0300 [thread overview]
Message-ID: <aeLRfy4k_9hLhEpG@ashevche-desk.local> (raw)
In-Reply-To: <20260417165747.507487-3-marcelomlage@usp.br>
On Fri, Apr 17, 2026 at 01:57:47PM -0300, Marcelo Machado Lage wrote:
> Replace manual bit manipulations with FIELD_GET(), FIELD_PREP() and
> FIELD_MODIFY() calls. The resulting code is more readable and
> maintainable, and 6 macros previously defined in the header are not
> needed anymore.
> Following a request by Jonathan Cameron, this version of the patch
> has 3 less macros than v1, now replaced by inline calls of FIELD_GET().
> Thanks, Jonathan!
This paragraph has to be in the comment block...
> Signed-off-by: Marcelo Machado Lage <marcelomlage@usp.br>
> Co-developed-by: Vinicius Lira <vinilira@usp.br>
> Signed-off-by: Vinicius Lira <vinilira@usp.br>
> ---
...id est somewhere here.
> drivers/iio/adc/mcp3422.c | 51 +++++++++++++++------------------------
> 1 file changed, 20 insertions(+), 31 deletions(-)
...
> static int mcp3422_read_raw(struct iio_dev *iio,
> struct mcp3422 *adc = iio_priv(iio);
> int err;
>
> - u8 sample_rate = MCP3422_SAMPLE_RATE(adc->config);
> - u8 pga = MCP3422_PGA(adc->config);
> + u8 sample_rate = FIELD_GET(MCP3422_SRATE_MASK, adc->config);
> + u8 pga = FIELD_GET(MCP3422_PGA_MASK, adc->config);
Please, use common practices and be aligned with the already used style in this
driver. These lines:
- has to be part of the definition block (no blank lines)
- use a single-space indentation approach (no need many spaces before =)
- be located in the form of longest line first (reversed xmas tree order)
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2026-04-18 0:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 16:57 [PATCH v2 0/2] iio: adc: mcp3422: apply bit manipulation macros Marcelo Machado Lage
2026-04-17 16:57 ` [PATCH v2 1/2] iio: adc: mcp3422: rewrite mask macros using bitfield macros Marcelo Machado Lage
2026-04-18 16:26 ` David Lechner
2026-04-19 13:24 ` Jonathan Cameron
2026-04-17 16:57 ` [PATCH v2 2/2] iio: adc: mcp3422: write bit operations with " Marcelo Machado Lage
2026-04-18 0:34 ` Andy Shevchenko [this message]
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=aeLRfy4k_9hLhEpG@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 \
--cc=y@ashevche-desk.local \
/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