Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Colin Huang via B4 Relay" <devnull+u8813345.gmail.com@kernel.org>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v2 3/3] hwmon: (pmbus) add support for Delta E50SN12051
Date: Thu, 30 Apr 2026 03:48:13 +0000	[thread overview]
Message-ID: <20260430034814.24145C2BCB8@smtp.kernel.org> (raw)
In-Reply-To: <20260430-add-e50sn12051-v2-3-d76fe42482ab@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Unnecessary memory allocation using devm_kmemdup for a static structure.
--

commit e0fb0b22fc908f166717510eea0ebcb85704a919
Author: Colin Huang <u8813345@gmail.com>

hwmon: (pmbus) add support for Delta E50SN12051

This commit introduces a new PMBus driver for the Delta E50SN12051 600W
Non-isolated 1/8th Brick DCDC Power Modules.

> diff --git a/drivers/hwmon/pmbus/e50sn12051.c b/drivers/hwmon/pmbus/e50sn12051.c
> new file mode 100644
> index 000000000000..3d61db949afb
> --- /dev/null
> +++ b/drivers/hwmon/pmbus/e50sn12051.c
[ ... ]
> +static int e50sn12051_probe(struct i2c_client *client)
> +{
> +	struct pmbus_driver_info *info;
> +
> +	info = devm_kmemdup(&client->dev, &e50sn12051_info, sizeof(*info),
> +			    GFP_KERNEL);
> +	if (!info)
> +		return -ENOMEM;
> +
> +	return pmbus_do_probe(client, info);
> +}

Is it necessary to duplicate the e50sn12051_info structure using
devm_kmemdup() here?

The e50sn12051_info structure is statically defined and fully populated at
compile time. Looking at the PMBus core, it only modifies the
pmbus_driver_info structure if the PMBUS_USE_COEFFICIENTS_CMD flag is set,
which is not the case for this driver.

Could this be simplified to pass &e50sn12051_info directly to
pmbus_do_probe() to avoid the extra memory allocation?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260430-add-e50sn12051-v2-0-d76fe42482ab@gmail.com?part=3

      reply	other threads:[~2026-04-30  3:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-30  3:01 [PATCH v2 0/3] add support for Delta E50SN12051 Colin Huang via B4 Relay
2026-04-30  3:01 ` [PATCH v2 1/3] dt-bindings: hwmon: pmbus: add Delta E50SN12051 binding Colin Huang via B4 Relay
2026-04-30  3:01 ` [PATCH v2 2/3] Documentation/hwmon: add Delta E50SN12051 documentation Colin Huang via B4 Relay
2026-04-30  3:01 ` [PATCH v2 3/3] hwmon: (pmbus) add support for Delta E50SN12051 Colin Huang via B4 Relay
2026-04-30  3:48   ` sashiko-bot [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=20260430034814.24145C2BCB8@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=devnull+u8813345.gmail.com@kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=sashiko@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