From: Jonathan Cameron <jic23@kernel.org>
To: Liviu Stan <liviu.stan@analog.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
"Francesco Lavra" <flavra@baylibre.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux@analog.com, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 1/7] iio: temperature: ltc2983: Fix macro parenthesization and rename
Date: Sat, 16 May 2026 17:43:18 +0100 [thread overview]
Message-ID: <20260516174318.3d613a42@jic23-huawei> (raw)
In-Reply-To: <20260514144712.64374-2-liviu.stan@analog.com>
On Thu, 14 May 2026 17:46:48 +0300
Liviu Stan <liviu.stan@analog.com> wrote:
> Wrap the 'chan' parameter in LTC2983_CHAN_START_ADDR() and
> LTC2983_CHAN_RES_ADDR() with parentheses to prevent potential
> macro argument expansion issues. Also rename LTC2983_CHAN_START_ADDR
> to LTC2983_CHAN_ASSIGN_ADDR and LTC2983_CHAN_RES_ADDR to
> LTC2983_RESULT_ADDR, to better reflect the datasheet names and avoid
> them being confused as related.
>
> Fixes: f110f3188e5639c81c457b2b831d40dfe3891bdb ("iio: temperature: Add support for LTC2983")
Firstly 12 chars of the hash is enough.
Secondly why a fix at all?
Looks like a readability improvement but not something we'd backport.
Also as Sashiko points out you need to mention the additional parameter.
https://sashiko.dev/#/patchset/20260514144712.64374-1-liviu.stan%40analog.com
Also, build your series one patch at a time. This looks like it won't build.
Jonathan
> Signed-off-by: Liviu Stan <liviu.stan@analog.com>
> ---
> Changes in v2:
> - New patch.
>
> drivers/iio/temperature/ltc2983.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c
> index 38e6f8dfd3b8..a292274e6ff0 100644
> --- a/drivers/iio/temperature/ltc2983.c
> +++ b/drivers/iio/temperature/ltc2983.c
> @@ -56,10 +56,10 @@
> #define LTC2983_EEPROM_WRITE_TIME_MS 2600
> #define LTC2983_EEPROM_READ_TIME_MS 20
>
> -#define LTC2983_CHAN_START_ADDR(chan) \
> - (((chan - 1) * 4) + LTC2983_CHAN_ASSIGN_START_REG)
> -#define LTC2983_CHAN_RES_ADDR(chan) \
> - (((chan - 1) * 4) + LTC2983_TEMP_RES_START_REG)
> +#define LTC2983_CHAN_ASSIGN_ADDR(chan) \
> + ((((chan) - 1) * 4) + LTC2983_CHAN_ASSIGN_START_REG)
> +#define LTC2983_RESULT_ADDR(chan, base) \
> + ((((chan) - 1) * 4) + (base))
> #define LTC2983_THERMOCOUPLE_DIFF_MASK BIT(3)
> #define LTC2983_THERMOCOUPLE_SGL(x) \
> FIELD_PREP(LTC2983_THERMOCOUPLE_DIFF_MASK, x)
> @@ -351,7 +351,7 @@ static int __ltc2983_chan_assign_common(struct ltc2983_data *st,
> const struct ltc2983_sensor *sensor,
> u32 chan_val)
> {
> - u32 reg = LTC2983_CHAN_START_ADDR(sensor->chan);
> + u32 reg = LTC2983_CHAN_ASSIGN_ADDR(sensor->chan);
>
> chan_val |= LTC2983_CHAN_TYPE(sensor->type);
> dev_dbg(&st->spi->dev, "Assign reg:0x%04X, val:0x%08X\n", reg,
> @@ -1197,7 +1197,7 @@ static int ltc2983_chan_read(struct ltc2983_data *st,
> }
>
> /* read the converted data */
> - ret = regmap_bulk_read(st->regmap, LTC2983_CHAN_RES_ADDR(sensor->chan),
> + ret = regmap_bulk_read(st->regmap, LTC2983_RESULT_ADDR(sensor->chan, base_reg),
> &st->temp, sizeof(st->temp));
> if (ret)
> return ret;
next prev parent reply other threads:[~2026-05-16 16:43 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 14:46 [PATCH v2 0/7] iio: temperature: ltc2983: Add support for ADT7604 Liviu Stan
2026-05-14 14:46 ` [PATCH v2 1/7] iio: temperature: ltc2983: Fix macro parenthesization and rename Liviu Stan
2026-05-14 19:32 ` sashiko-bot
2026-05-16 16:43 ` Jonathan Cameron [this message]
2026-05-14 14:46 ` [PATCH v2 2/7] iio: temperature: ltc2983: Use local device pointer consistently Liviu Stan
2026-05-14 19:39 ` sashiko-bot
2026-05-16 16:46 ` Jonathan Cameron
2026-05-14 14:46 ` [PATCH v2 3/7] iio: temperature: ltc2983: Fix inconsistent channel wording in messages Liviu Stan
2026-05-14 19:47 ` sashiko-bot
2026-05-16 16:48 ` Jonathan Cameron
2026-05-14 14:46 ` [PATCH v2 4/7] iio: temperature: ltc2983: Use fwnode_property_present() for optional properties Liviu Stan
2026-05-14 20:04 ` sashiko-bot
2026-05-16 16:53 ` Jonathan Cameron
2026-05-14 14:46 ` [PATCH v2 5/7] iio: core: Add IIO_COVERAGE_PERCENT channel type Liviu Stan
2026-05-14 20:16 ` sashiko-bot
2026-05-15 8:38 ` Francesco Lavra
2026-05-15 9:01 ` Stan, Liviu
2026-05-16 16:58 ` Jonathan Cameron
2026-05-14 14:46 ` [PATCH v2 6/7] dt-bindings: iio: temperature: Add ADT7604 support to adi,ltc2983 Liviu Stan
2026-05-14 20:43 ` sashiko-bot
2026-05-16 17:03 ` Jonathan Cameron
2026-05-14 14:46 ` [PATCH v2 7/7] iio: temperature: ltc2983: Add support for ADT7604 Liviu Stan
2026-05-15 8:38 ` Francesco Lavra
2026-05-15 9:07 ` Stan, Liviu
2026-05-16 17:12 ` Jonathan Cameron
2026-05-15 6:42 ` [PATCH v2 0/7] " Stan, Liviu
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=20260516174318.3d613a42@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=antoniu.miclaus@analog.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=flavra@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@analog.com \
--cc=liviu.stan@analog.com \
--cc=nuno.sa@analog.com \
--cc=robh@kernel.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