From: sashiko-bot@kernel.org
To: "Ariana Lazar" <ariana.lazar@microchip.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v6 02/11] iio: dac: mcp47feb02: Fix gain field initialization for active channels
Date: Wed, 16 Sep 2026 14:29:12 +0000 [thread overview]
Message-ID: <20260916142913.148C51F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260916-mcp47feb02_refactor-v6-2-285464651f89@microchip.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] iio: dac: unused macro MCP47FEB02_GAIN_BIT_MASK
--
commit 9156f8c32ec03099abf89f1f0f71cf04b9870e24
Author: Ariana Lazar <ariana.lazar@microchip.com>
iio: dac: mcp47feb02: Fix gain field initialization for active channels
As per MCP47FXBX48 Datasheet, in the format of the Gain Control and System
Status Register each DAC channel has one bit to control its gain,
starting at bit 8, while bits 0-7 contain status or unimplemented bits.
The patch updates the driver to use field_get() for correctly extracting
the gain control bit for each active channel.
Link: https://lore.kernel.org/all/20260804134616.1D8A21F00A3E@smtp.kernel.org/
> diff --git a/drivers/iio/dac/mcp47feb02.c b/drivers/iio/dac/mcp47feb02.c
> index 6a3875e1d6a2c..fa4bd1df95484 100644
> --- a/drivers/iio/dac/mcp47feb02.c
> +++ b/drivers/iio/dac/mcp47feb02.c
> @@ -1016,7 +1016,6 @@ static int mcp47feb02_init_ctrl_regs(struct mcp47feb02_data *data)
> if (ret)
> return ret;
>
> - gain_ch = gain_ch & MCP47FEB02_GAIN_BITS_MASK;
> for_each_set_bit(i, &data->active_channels_mask, data->phys_channels) {
> struct device *dev = regmap_get_device(data->regmap);
> unsigned int pd_tmp, dac_val;
> @@ -1027,7 +1026,7 @@ static int mcp47feb02_init_ctrl_regs(struct mcp47feb02_data *data)
> data->chdata[i].dac_data = dac_val;
>
> data->chdata[i].ref_mode = (vref_ch >> (2 * i)) & MCP47FEB02_DAC_CTRL_MASK;
> - data->chdata[i].use_2x_gain = (gain_ch >> i) & MCP47FEB02_GAIN_BIT_MASK;
> + data->chdata[i].use_2x_gain = field_get(DAC_GAIN_MASK(i), gain_ch);
[Severity: Low]
Does this leave the MCP47FEB02_GAIN_BIT_MASK macro defined but unused?
Since this was its only usage in mcp47feb02_init_ctrl_regs(), should the
definition also be removed from drivers/iio/dac/mcp47feb02.c?
> /*
> * Inform the user that the current voltage reference read from the volatile
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260916-mcp47feb02_refactor-v6-0-285464651f89@microchip.com?part=2
next prev parent reply other threads:[~2026-09-16 14:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 14:16 [PATCH v6 00/11] Refactor Microchip MCP47FEB02 I2C driver in separate modules to add support for MCP48FEB02 SPI driver Ariana Lazar
2026-09-16 14:16 ` [PATCH v6 01/11] iio: dac: mcp47feb02: initialize dac_data field in channel data struct at probe Ariana Lazar
2026-09-16 14:16 ` [PATCH v6 02/11] iio: dac: mcp47feb02: Fix gain field initialization for active channels Ariana Lazar
2026-09-16 14:29 ` sashiko-bot [this message]
2026-09-16 14:16 ` [PATCH v6 03/11] iio: dac: mcp47feb02: use field_get() instead of custom dynamic macros Ariana Lazar
2026-09-16 15:22 ` Andy Shevchenko
2026-09-16 14:16 ` [PATCH v6 04/11] iio: dac: mcp47feb02: Return len when disabling EEPROM store Ariana Lazar
2026-09-16 14:16 ` [PATCH v6 05/11] iio: dac: mcp47feb02: Increase EEPROM Programming Write Cycle Time Ariana Lazar
2026-09-16 14:16 ` [PATCH v6 06/11] iio: dac: mcp47feb02: Avoid unjustified probe error on missing label Ariana Lazar
2026-09-16 14:29 ` sashiko-bot
2026-09-16 14:16 ` [PATCH v6 07/11] iio: dac: mcp47feb02: correct typo from a comment Ariana Lazar
2026-09-16 15:49 ` Joshua Crofts
2026-09-16 14:16 ` [PATCH v6 08/11] iio: dac: mcp47feb02: rename channel mask and value macros Ariana Lazar
2026-09-17 0:53 ` Jonathan Cameron
2026-09-16 14:16 ` [PATCH v6 09/11] iio: dac: mcp47feb02: refactor MCP47FEB02 I2C driver into two modules Ariana Lazar
2026-09-16 14:16 ` [PATCH v6 10/11] dt-bindings: iio: dac: add support for MCP48FEB02 SPI Ariana Lazar
2026-09-16 14:16 ` [PATCH v6 11/11] iio: dac: add support for Microchip MCP48FEB02 Ariana Lazar
2026-09-16 15:26 ` [PATCH v6 00/11] Refactor Microchip MCP47FEB02 I2C driver in separate modules to add support for MCP48FEB02 SPI driver Andy Shevchenko
2026-09-17 0:55 ` 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=20260916142913.148C51F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=ariana.lazar@microchip.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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