Re: [PATCH v14 1/9] firmware: qcom_scm: ipq5332: add support to pass metadata size

[email protected] Mon, 03 Aug 2026 10:55:43 +0000
Newsgroups org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The format specifier `%pe` is used with `PTR_ERR(gunyah_wdt_dev)`, causing a variadic type mismatch since `%pe` expects a pointer while `PTR_ERR()` returns a `long`.
--

--- Patch [1]: [PATCH v14 1/9] firmware: qcom_scm: ipq5332: add support to pass metadata size ---
commit fc14da7f3ebc47ea633f966df3048e0592f524ee
Author: Manikanta Mylavarapu <[email protected]>

firmware: qcom_scm: ipq5332: add support to pass metadata size

IPQ5332 security software running under trustzone requires metadata size.
With new command support added in TrustZone that includes a size parameter,
this passes the metadata size as well.

> diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
> index 3eaa4c9ccf3cc..8902c445cf19f 100644
> --- a/drivers/firmware/qcom/qcom_scm.c
> +++ b/drivers/firmware/qcom/qcom_scm.c
[ ... ]
> @@ -2528,7 +2536,7 @@ static void qcom_scm_gunyah_wdt_init(struct qcom_scm *scm)
>  	gunyah_wdt_dev = platform_device_register_simple("gunyah-wdt", -1,
>  							 NULL, 0);
>  	if (IS_ERR(gunyah_wdt_dev)) {
> -		dev_err(scm->dev, "Failed to register Gunyah watchdog device: %ld\n",
> +		dev_err(scm->dev, "Failed to register Gunyah watchdog device: %pe\n",
>  			PTR_ERR(gunyah_wdt_dev));

[Severity: Medium]
Will this type mismatch cause formatting or build issues?

The %pe format specifier strictly expects a pointer, but PTR_ERR() returns a
long. Passing a long to %pe violates C variadic argument typing rules and
triggers a compiler warning that could break the build in configurations
using -Werror. At runtime, accessing a long as a pointer from va_list can
lead to undefined behavior depending on the architecture's calling
convention.

Could PTR_ERR() be removed so that gunyah_wdt_dev is passed directly to %pe?

>  		return;
>  	}

-- 
Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=1