From: sashiko-bot@kernel.org
To: "Daniel Lezcano" <daniel.lezcano@oss.qualcomm.com>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v2 02/12] thermal/of: Move OF code where it belongs to
Date: Wed, 22 Apr 2026 21:49:51 +0000 [thread overview]
Message-ID: <20260422214951.92EB7C19425@smtp.kernel.org> (raw)
In-Reply-To: <20260422174305.2899095-3-daniel.lezcano@oss.qualcomm.com>
Sashiko AI review found 2 potential issue(s):
- [High] A syntax error is introduced in `include/linux/thermal.h` when `CONFIG_THERMAL` is disabled, breaking compilation. Note: I found the fix later in the series in commit fb0063667bcf5 ("thermal/core: Remove node pointer parameter when registering a tz").
- [High] The patch intentionally breaks cooling device registration for non-OF drivers on systems without `CONFIG_THERMAL_OF` enabled, causing runtime regressions. Note: I found the fix later in the series in commit b79ce9cd7a188 ("hwmon:: Use non-OF thermal cooling device register function").
--
commit 7dfab179cb2bd36aaace42ff2d1aeceaaeb233da
Author: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
thermal/of: Move OF code where it belongs to
This commit moves thermal_of_cooling_device_register and
devm_thermal_of_cooling_device_register from thermal-core to thermal-of.
It adds temporary stubs returning errors for non-OF drivers when
CONFIG_THERMAL_OF is disabled.
> As the thermal-of file depends on CONFIG_THERMAL_OF=y, by moving these
> two functions in it, when non-OF drivers are using this API that
> results in a link issue. In order to prevent unnecessary
> circumvolutions with the changes, the stubs have been added in the
> header file resulting in having the non-OF drivers compiled without
> the CONFIG_THERMAL_OF=y using these stubs and failing to register
> their cooling devices.
>
> This is temporary as the next changes introduces the functions for
> non-OF drivers and returning to the initial state.
Is it acceptable to temporarily break cooling device registration for
non-OF drivers when CONFIG_THERMAL_OF is disabled?
Since the stubs return ERR_PTR(-ENODEV), it looks like non-OF drivers will
fail to register their cooling devices during this window.
I noticed this is fixed later in the series in commit b79ce9cd7a188, but
does introducing an intentional functional regression here break git bisect?
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
[ ... ]
> @@ -305,18 +323,7 @@ thermal_cooling_device_register(const char *type, void *devdata,
> const struct thermal_cooling_device_ops *ops)
> { return ERR_PTR(-ENODEV); }
> static inline struct thermal_cooling_device *
> -thermal_of_cooling_device_register(struct device_node *np,
> - const char *type, void *devdata,
> - const struct thermal_cooling_device_ops *ops)
> -{ return ERR_PTR(-ENODEV); }
> -static inline struct thermal_cooling_device *
> -devm_thermal_of_cooling_device_register(struct device *dev,
> - struct device_node *np,
> - const char *type, void *devdata,
> - const struct thermal_cooling_device_ops *ops)
> -{
> - return ERR_PTR(-ENODEV);
> -}
> +
> static inline void thermal_cooling_device_unregister(
> struct thermal_cooling_device *cdev)
> { }
Does this leave a dangling return type that causes a compiler syntax error
when CONFIG_THERMAL is disabled?
I see this was also fixed later in the series by commit fb0063667bcf5, but
does leaving this invalid C syntax here hurt bisectability for builds
without CONFIG_THERMAL?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260422174305.2899095-1-daniel.lezcano@oss.qualcomm.com?part=2
next prev parent reply other threads:[~2026-04-22 21:49 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 17:42 [PATCH v2 00/12] Support cooling device with ID in the OF Daniel Lezcano
2026-04-22 17:42 ` [PATCH v2 01/12] thermal/driver/tegra/soctherm: Use devm_ variant when registering a cooling device Daniel Lezcano
2026-04-22 21:38 ` sashiko-bot
2026-04-22 17:42 ` [PATCH v2 02/12] thermal/of: Move OF code where it belongs to Daniel Lezcano
2026-04-22 21:49 ` sashiko-bot [this message]
2026-04-22 17:42 ` [PATCH v2 03/12] thermal/core: Make thermal_cooling_device_init_complete() non static Daniel Lezcano
2026-04-22 17:42 ` [PATCH v2 04/12] thermal/core: Remove node pointer parameter when registering a tz Daniel Lezcano
2026-04-22 22:25 ` sashiko-bot
2026-04-22 17:42 ` [PATCH v2 05/12] thermal/of: Move the node pointer assignation in the OF code file Daniel Lezcano
2026-04-22 22:50 ` sashiko-bot
2026-04-22 17:42 ` [PATCH v2 06/12] hwmon:: Use non-OF thermal cooling device register function Daniel Lezcano
2026-04-22 17:42 ` [PATCH v2 07/12] thermal/core: Put of_node field cooling device structure under Kconfig option Daniel Lezcano
2026-04-22 23:19 ` sashiko-bot
2026-04-22 17:42 ` [PATCH v2 08/12] thermal/of: Rename the devm_thermal_of_cooling_device_register() function Daniel Lezcano
2026-04-22 23:33 ` sashiko-bot
2026-04-22 17:42 ` [PATCH v2 09/12] thermal/of: Introduce cooling device of_index Daniel Lezcano
2026-04-22 23:48 ` sashiko-bot
2026-04-22 17:42 ` [PATCH v2 10/12] thermal/of: Pass the of_index and add a function to register with an index Daniel Lezcano
2026-04-22 17:43 ` [PATCH v2 11/12] thermal/of: Process cooling device index in cooling-spec Daniel Lezcano
2026-04-22 17:43 ` [PATCH v2 12/12] dt-bindings: thermal: cooling-devices: Update support for 3 cells cooling device Daniel Lezcano
2026-04-23 0:23 ` sashiko-bot
2026-04-23 8:33 ` Krzysztof Kozlowski
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=20260422214951.92EB7C19425@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=daniel.lezcano@oss.qualcomm.com \
--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