All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Alex Tran" <alex.tran@oss.qualcomm.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH 5/5] pinctrl: pinctrl-scmi: Log number of pins, groups, functions
Date: Thu, 14 May 2026 09:07:25 +0000	[thread overview]
Message-ID: <20260514090725.C63B3C2BCC7@smtp.kernel.org> (raw)
In-Reply-To: <20260513-scmi-client-probe-log-v1-5-00b47b1be009@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] Unhandled error code from pinctrl_scmi_get_groups_count() masks firmware failure.
- [Low] Unnecessary persistent state added to struct scmi_pinctrl.
- [Low] Format string type mismatch in dev_info() logging.
--

commit d7d0dd8e474d3b2b3d8c68dd2d8713e62d0299a0
Author: Alex Tran <alex.tran@oss.qualcomm.com>

pinctrl: pinctrl-scmi: Log number of pins, groups, functions

The SCMI pinctrl driver does not currently log the number of pins,
groups, and functions discovered from firmware.

> diff --git a/drivers/pinctrl/pinctrl-scmi.c b/drivers/pinctrl/pinctrl-scmi.c
> index f22be6b7b82a4..abc90a3a7eaf4 100644
> --- a/drivers/pinctrl/pinctrl-scmi.c
> +++ b/drivers/pinctrl/pinctrl-scmi.c
> @@ -40,6 +40,7 @@ struct scmi_pinctrl {
>  	struct pinctrl_desc pctl_desc;
>  	struct pinfunction *functions;
>  	unsigned int nr_functions;
> +	unsigned int nr_groups;
>  };

Does nr_groups need to be stored in the scmi_pinctrl struct? It looks like
it is only used once in scmi_pinctrl_probe() for logging, so could it be
declared as a local variable instead?

[ ... ]

> @@ -578,7 +579,15 @@ static int scmi_pinctrl_probe(struct scmi_device *sdev)
>  	if (!pmx->functions)
>  		return -ENOMEM;
>  
> -	return pinctrl_enable(pmx->pctldev);
> +	pmx->nr_groups = pinctrl_scmi_get_groups_count(pmx->pctldev);

Can pinctrl_scmi_get_groups_count() return a negative error code here if the
firmware fails? Since pmx->nr_groups is an unsigned int, would a negative
error code be implicitly cast to a large positive value and mask the failure?

> +
> +	ret = pinctrl_enable(pmx->pctldev);
> +	if (ret)
> +		return ret;
> +
> +	dev_info(dev, "Initialized %d pins, %d groups, %d functions\n",
> +		 pmx->pctl_desc.npins, pmx->nr_groups, pmx->nr_functions);

This isn't a bug, but the variables npins, nr_groups, and nr_functions are
all unsigned integers. Should these format specifiers be %u instead of %d?

> +	return 0;
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260513-scmi-client-probe-log-v1-0-00b47b1be009@oss.qualcomm.com?part=5

  reply	other threads:[~2026-05-14  9:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 16:44 [PATCH 0/5] scmi: Log client subsystem entity counts Alex Tran
2026-05-13 16:44 ` [PATCH 1/5] powercap: arm_scmi_powercap: Log number of powercap domains Alex Tran
2026-05-14  7:36   ` sashiko-bot
2026-05-13 16:44 ` [PATCH 2/5] cpufreq: scmi-cpufreq: Log number of perf domains Alex Tran
2026-05-14  8:06   ` sashiko-bot
2026-05-13 16:44 ` [PATCH 3/5] hwmon: scmi-hwmon: Log number of sensors Alex Tran
2026-05-13 16:47   ` Guenter Roeck
2026-05-14  8:10   ` sashiko-bot
2026-05-13 16:44 ` [PATCH 4/5] reset: reset-scmi: Log number of reset domains Alex Tran
2026-05-14  8:20   ` sashiko-bot
2026-05-13 16:44 ` [PATCH 5/5] pinctrl: pinctrl-scmi: Log number of pins, groups, functions Alex Tran
2026-05-14  9:07   ` sashiko-bot [this message]
2026-05-13 18:02 ` [PATCH 0/5] scmi: Log client subsystem entity counts Andy Shevchenko
2026-05-13 18:27   ` Guenter Roeck
2026-05-14  6:48     ` Greg Kroah-Hartman
2026-05-14 10:38       ` Sudeep Holla

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=20260514090725.C63B3C2BCC7@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alex.tran@oss.qualcomm.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.