All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
Cc: conor+dt@kernel.org, robh@kernel.org, dmitry.torokhov@gmail.com,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 07/10] mfd: wm831x: support software nodes for DCDC regulators
Date: Sun, 12 Jul 2026 02:20:21 +0000	[thread overview]
Message-ID: <20260712022021.E022D1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260711-samsung-kp-v3-7-b2fcaba77aff@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The patch dynamically duplicates and modifies an `mfd_cell` array to inject software nodes, directly violating MFD subsystem guidelines.
- [Low] The commit message description starts with a lowercase letter, violating MFD subsystem formatting rules.
--

--- Patch [7]: [PATCH v3 07/10] mfd: wm831x: support software nodes for DCDC regulators ---
commit 3d69bbb3a9fcf1555157438b7a85ed2a2744e94b
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>

mfd: wm831x: support software nodes for DCDC regulators

This commit allows passing software nodes to wm831x DCDC regulators via PMIC
platform data. It adds dcdc_swnodes to the PMIC platform data and dynamically
assigns these software nodes to the buckv cells during device addition.

> mfd: wm831x: support software nodes for DCDC regulators

[Severity: Low]
This isn't a bug, but should the description after the subsystem prefix be
capitalized? The MFD subsystem conventions generally expect:
"mfd: wm831x: Support software nodes for DCDC regulators".

> diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c
> --- a/drivers/mfd/wm831x-core.c
> +++ b/drivers/mfd/wm831x-core.c

[ ... ]

> @@ -1449,6 +1450,32 @@ const struct of_device_id wm831x_of_match[] = {
>  };
>  EXPORT_SYMBOL_GPL(wm831x_of_match);
>  
> +static int wm831x_add_devices(struct wm831x *wm831x, int wm831x_num,
> +			      const struct mfd_cell *cells, int num_cells)
> +{
> +	struct wm831x_pdata *pdata = &wm831x->pdata;
> +	int i;
> +
> +	struct mfd_cell *local_cells __free(kfree) =
> +		kmemdup_array(cells, num_cells, sizeof(*cells), GFP_KERNEL);

[Severity: Medium]
Does this code dynamically duplicate the mfd_cell array to amend it?

The MFD subsystem guidelines advise that mfd_cell arrays should remain static
references, and we should avoid creating local copies for dynamic amendments.
Is there an alternative way to pass the software nodes without allocating and
modifying a duplicated cell array?

> +	if (!local_cells)
> +		return -ENOMEM;
> +
> +	for (i = 0; i < num_cells; i++) {
> +		struct mfd_cell *cell = &local_cells[i];
> +
> +		if (strcmp(cell->name, "wm831x-buckv") == 0) {
> +			int id = cell->id - 1;
> +
> +			if (id >= 0 && id < WM831X_MAX_DCDC)
> +				cell->swnode = pdata->dcdc_swnodes[id];
> +		}
> +	}
> +
> +	return mfd_add_devices(wm831x->dev, wm831x_num, local_cells, num_cells,
> +			       NULL, 0, NULL);
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260711-samsung-kp-v3-0-b2fcaba77aff@gmail.com?part=7

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

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-12  2:12 [PATCH v3 00/10] Remove support for platform data from samsung keypad Dmitry Torokhov
2026-07-12  2:12 ` [PATCH v3 01/10] dt-bindings: input: samsung,s3c6410-keypad: introduce compact binding Dmitry Torokhov
2026-07-12  2:22   ` sashiko-bot
2026-07-12  2:12 ` [PATCH v3 02/10] Input: samsung-keypad - handle " Dmitry Torokhov
2026-07-12  2:24   ` sashiko-bot
2026-07-12  2:12 ` [PATCH v3 03/10] ARM: s3c: register and attach software nodes for Samsung gpio_chips Dmitry Torokhov
2026-07-12  2:24   ` sashiko-bot
2026-07-12  2:12 ` [PATCH v3 04/10] ARM: s3c: crag6410: switch keypad device to software properties Dmitry Torokhov
2026-07-12  2:12 ` [PATCH v3 05/10] Input: samsung-keypad - remove support for platform data Dmitry Torokhov
2026-07-12  2:22   ` sashiko-bot
2026-07-12  2:12 ` [PATCH v3 06/10] ARM: s3c: crag6410: use software nodes/properties to set up GPIO keys Dmitry Torokhov
2026-07-12  2:21   ` sashiko-bot
2026-07-12  2:12 ` [PATCH v3 07/10] mfd: wm831x: support software nodes for DCDC regulators Dmitry Torokhov
2026-07-12  2:20   ` sashiko-bot [this message]
2026-07-12  2:12 ` [PATCH v3 08/10] ARM: s3c: crag6410: convert PMIC DVS GPIO to software properties Dmitry Torokhov
2026-07-12  2:32   ` sashiko-bot
2026-07-12  2:12 ` [PATCH v3 09/10] ARM: s3c: crag6410: convert basic-mmio-gpio and LEDs " Dmitry Torokhov
2026-07-12  2:12 ` [PATCH v3 10/10] ARM: s3c: crag6410: convert remaining GPIO lookup tables to property entries Dmitry Torokhov
2026-07-12 12:30 ` [PATCH v3 00/10] Remove support for platform data from samsung keypad Krzysztof Kozlowski
2026-07-13 23:28   ` Dmitry Torokhov

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=20260712022021.E022D1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@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 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.