From: sashiko-bot@kernel.org
To: "Xianwei Zhao" <xianwei.zhao@amlogic.com>
Cc: devicetree@vger.kernel.org, linux-amlogic@lists.infradead.org,
robh@kernel.org, conor+dt@kernel.org, neil.armstrong@linaro.org
Subject: Re: [PATCH v6 2/3] pwm: meson: add the PWM count driver data
Date: Tue, 01 Dec 2026 03:38:54 +0000 [thread overview]
Message-ID: <sashiko-outbox-242454@kernel.org> (raw)
In-Reply-To: <20261201-s6-s7-pwm-v6-2-703cc13d4da5@amlogic.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] pwm: meson: MESON_NUM_PWMS retained and literal 2 used in
meson_pwm_probe()
--
commit 6ed68747213a295ffa942a4e360553ca50e1dfff
Author: Xianwei Zhao <xianwei.zhao@amlogic.com>
pwm: meson: add the PWM count driver data
This commit adds an npwm field to struct meson_pwm_data, sets it to 2 for
existing variants, and replaces MESON_NUM_PWMS with chip->npwm and
pdata->npwm in clock initialization and probe.
> diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
> index 3a28c853089f8..a4b5f38776070 100644
> --- a/drivers/pwm/pwm-meson.c
> +++ b/drivers/pwm/pwm-meson.c
[ ... ]
> @@ -699,9 +710,12 @@ static int meson_pwm_probe(struct platform_device *pdev)
> {
> struct pwm_chip *chip;
> struct meson_pwm *meson;
> + const struct meson_pwm_data *pdata = of_device_get_match_data(&pdev->dev);
> int err;
>
> - chip = devm_pwmchip_alloc(&pdev->dev, MESON_NUM_PWMS, sizeof(*meson));
> + if (pdata->npwm > 2)
> + return -EINVAL;
> + chip = devm_pwmchip_alloc(&pdev->dev, pdata->npwm, sizeof(*meson));
[Severity: Low]
As reported by Uwe Kleine-König on v4 [1], can MESON_NUM_PWMS be dropped
in this commit? It is still defined to size
meson_pwm_per_channel_data[] and meson->channels[], while
meson_pwm_probe() checks pdata->npwm > 2 using a literal 2 instead of
sizing meson_pwm_per_channel_data[] and meson->channels[] without the
macro and bounding against ARRAY_SIZE().
[1] https://lore.kernel.org/r/aw01OAIy4gGjXvDI@monoceros
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261201-s6-s7-pwm-v6-0-703cc13d4da5@amlogic.com?part=2
next prev parent reply other threads:[~2026-12-01 3:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 3:34 [PATCH v6 0/3] Add PWM support Amlogic S7 S7D S6 Xianwei Zhao via B4 Relay
2026-12-01 3:34 ` [PATCH v6 1/3] dt-bindings: pwm: amlogic: Add S6, S7 and S7D PWM Xianwei Zhao via B4 Relay
2026-12-01 3:34 ` [PATCH v6 2/3] pwm: meson: add the PWM count driver data Xianwei Zhao via B4 Relay
2026-12-01 3:38 ` sashiko-bot [this message]
2026-12-01 3:34 ` [PATCH v6 3/3] pwm: meson: Add support for Amlogic S7 Xianwei Zhao via B4 Relay
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=sashiko-outbox-242454@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=xianwei.zhao@amlogic.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox