From: sashiko-bot@kernel.org
To: "Alexis Czezar Torreno" <alexisczezar.torreno@analog.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH 2/3] hwmon: (pmbus/max34440): add support for newer version of max34451
Date: Thu, 16 Jul 2026 08:35:43 +0000 [thread overview]
Message-ID: <20260716083544.1B5B91F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260716-max34451_fixes-v1-2-a941b27eaecb@analog.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Forward compatibility issue in ETNA8+ revision check due to strict equality
--
--- Patch [2]: [PATCH 2/3] hwmon: (pmbus/max34440): add support for newer version of max34451 ---
commit 02e46b67255562393d163820572cc52a0cabe3e7
Author: Alexis Czezar Torreno <alexisczezar.torreno@analog.com>
hwmon: (pmbus/max34440): add support for newer version of max34451
This commit adds support for the max34451etna8+ hardware revision.
It updates the direct format coefficients specifically for this newer
revision.
> diff --git a/drivers/hwmon/pmbus/max34440.c b/drivers/hwmon/pmbus/max34440.c
> index e56057e9273c1..024109df26db5 100644
> --- a/drivers/hwmon/pmbus/max34440.c
> +++ b/drivers/hwmon/pmbus/max34440.c
[ ... ]
> @@ -343,12 +344,24 @@ static int max34451_set_supported_funcs(struct i2c_client *client,
> max34451_na6 = true;
> data->info.format[PSC_VOLTAGE_IN] = direct;
> data->info.format[PSC_CURRENT_IN] = direct;
> - data->info.m[PSC_VOLTAGE_IN] = 1;
> +
> data->info.b[PSC_VOLTAGE_IN] = 0;
> - data->info.R[PSC_VOLTAGE_IN] = 3;
> - data->info.m[PSC_CURRENT_IN] = 1;
> data->info.b[PSC_CURRENT_IN] = 0;
> - data->info.R[PSC_CURRENT_IN] = 2;
> + if (rv == MAX34451ETNA8_MFR_REV) {
[Severity: Medium]
Will this strict equality check cause issues with future hardware revisions?
The commit message mentions adding support for the ETNA8+ version, but if a
subsequent hardware revision probes with a manufacturer revision greater than
MAX34451ETNA8_MFR_REV (e.g., 0x0015), the outer check
rv >= MAX34451ETNA6_MFR_REV will evaluate to true, but this inner check will
fail.
This causes the code to silently fall through to the else block, regressing to
the older ETNA6 coefficients rather than retaining the newer ETNA8 ones.
Could this use >= instead of == to maintain forward compatibility, similar
to how ETNA6 is checked on line 328?
> + data->info.m[PSC_VOLTAGE_IN] = 125;
> + data->info.R[PSC_VOLTAGE_IN] = 0;
> + data->info.m[PSC_VOLTAGE_OUT] = 125;
> + data->info.R[PSC_VOLTAGE_OUT] = 0;
> + data->info.m[PSC_CURRENT_IN] = 250;
> + data->info.R[PSC_CURRENT_IN] = -1;
> + data->info.m[PSC_CURRENT_OUT] = 250;
> + data->info.R[PSC_CURRENT_OUT] = -1;
> + } else {
> + data->info.m[PSC_VOLTAGE_IN] = 1;
> + data->info.R[PSC_VOLTAGE_IN] = 3;
> + data->info.m[PSC_CURRENT_IN] = 1;
> + data->info.R[PSC_CURRENT_IN] = 2;
> + }
> data->iout_oc_fault_limit = PMBUS_IOUT_OC_FAULT_LIMIT;
> data->iout_oc_warn_limit = PMBUS_IOUT_OC_WARN_LIMIT;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260716-max34451_fixes-v1-0-a941b27eaecb@analog.com?part=2
next prev parent reply other threads:[~2026-07-16 8:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 8:25 [PATCH 0/3] hwmon: (pmbus/max34440): Bug fixes and supporting new device Alexis Czezar Torreno
2026-07-16 8:25 ` [PATCH 1/3] hwmon: (pmbus/max34440): block unsupported VIN and IIN limit registers Alexis Czezar Torreno
2026-07-16 8:38 ` sashiko-bot
2026-07-16 8:25 ` [PATCH 2/3] hwmon: (pmbus/max34440): add support for newer version of max34451 Alexis Czezar Torreno
2026-07-16 8:35 ` sashiko-bot [this message]
2026-07-16 8:25 ` [PATCH 3/3] hwmon: (pmbus/max34440): Add support for MAX34452 Alexis Czezar Torreno
2026-07-16 8:38 ` sashiko-bot
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=20260716083544.1B5B91F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=alexisczezar.torreno@analog.com \
--cc=linux-hwmon@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.