All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Stoyan Bogdanov" <sbogdanov@baylibre.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org,
	linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v5 1/3] hwmon: (pmbus/tps25990): Rework driver for multi-device support
Date: Tue, 28 Jul 2026 02:07:03 +0000	[thread overview]
Message-ID: <20260728020703.EFC111F00AC4@smtp.kernel.org> (raw)
In-Reply-To: <20260728015857.193890-2-sbogdanov@baylibre.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The static array `tps25990_base_info` is missing the `const` qualifier, placing it in mutable `.data` memory instead of read-only `.rodata`.
- [Low] The `tps25990_i2c_id` array uses positional initializers, which violates the I2C subsystem's coding guidelines.
--

--- Patch [1]: [PATCH v5 1/3] hwmon: (pmbus/tps25990): Rework driver for multi-device support ---
commit 7c6d03feb4ad36395a77df5021ef6a8c6f2df2a8
Author: Stoyan Bogdanov <sbogdanov@baylibre.com>

hwmon: (pmbus/tps25990): Rework driver for multi-device support

This commit reworks the tps25990 driver to allow adding support for new
devices. It introduces a chip enumeration and a data structure to hold
per-device measurement coefficients.

> diff --git a/drivers/hwmon/pmbus/tps25990.c b/drivers/hwmon/pmbus/tps25990.c
> index 9d318e6509abf..490dcd2a5fa51 100644
> --- a/drivers/hwmon/pmbus/tps25990.c
> +++ b/drivers/hwmon/pmbus/tps25990.c
[ ... ]
> -static const struct pmbus_driver_info tps25990_base_info = {
> -	.pages = 1,
[ ... ]
> -#if IS_ENABLED(CONFIG_SENSORS_TPS25990_REGULATOR)
> -	.reg_desc = tps25990_reg_desc,
> -	.num_regulators = ARRAY_SIZE(tps25990_reg_desc),
> -#endif
> -};
> -
> +static struct pmbus_driver_info tps25990_base_info[] = {
> +	[tps25990] = {
> +		.pages = 1,

[Severity: Medium]
Should this array be declared const?

The previous single structure was const, but the new array drops the const
qualifier. Leaving tps25990_base_info mutable places the struct's function
pointers in mutable .data memory instead of read-only .rodata.

[ ... ]
>  static const struct i2c_device_id tps25990_i2c_id[] = {
> -	{ .name = "tps25990" },
> -	{ }
> +	{ "tps25990", tps25990 },
> +	{}
>  };
>  MODULE_DEVICE_TABLE(i2c, tps25990_i2c_id);

[Severity: Low]
Does this code run counter to the I2C subsystem coding guidelines?

The guidelines specify that initialized arrays of type struct i2c_device_id
must use named initializers, but this patch changes the initialization to
use positional initializers instead.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260728015857.193890-1-sbogdanov@baylibre.com?part=1

  reply	other threads:[~2026-07-28  2:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28  1:58 [PATCH v5 0/3] Rework TPS25990 direct conversions and add TPS1689 support Stoyan Bogdanov
2026-07-28  1:58 ` [PATCH v5 1/3] hwmon: (pmbus/tps25990): Rework driver for multi-device support Stoyan Bogdanov
2026-07-28  2:07   ` sashiko-bot [this message]
2026-07-28  3:41     ` Guenter Roeck
2026-07-28  1:58 ` [PATCH v5 2/3] dt-bindings: hwmon: pmbus/tps25990: Add TPS1689 Stoyan Bogdanov
2026-07-28  2:04   ` sashiko-bot
2026-07-28  1:58 ` [PATCH v5 3/3] hwmon: (pmbus/tps25990): Add TPS1689 support Stoyan Bogdanov
2026-07-28  2:09   ` sashiko-bot
2026-07-28  4:11   ` Guenter Roeck

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=20260728020703.EFC111F00AC4@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sbogdanov@baylibre.com \
    /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.