firmware: samsung: acpm: remove compile-testing stubs
Subsystems (4)
PATCH 1/1 firmware: samsung: acpm: remove compile-testing stubs
From: Arnd Bergmann <[email protected]>
Sashiko reported an inconsistent use of NULL vs ERR_PTR() returns in the stub helpers in xynos-acpm-protocol.h.
Since this only happens on dead code for COMPILE_TEST=y, this is not really a bug though. Having stub functions that return NULL is a common way to define optional interfaces, where callers still work when the feature is disabled, though this clearly does not work for acpm because some callers have a NULL pointer dereference when compile testing.
Since CONFIG_EXYNOS_ACPM_PROTOCOL already supports compile-testing itself, and all (both) drivers using it clearly require the support, so this just simplifies the option space without losing any build coverage.
Remove the stub functions entirely and adjust the one Kconfig dependency to require EXYNOS_ACPM_PROTOCOL unconditionally.
--- drivers/clk/samsung/Kconfig | 2 +- .../linux/firmware/samsung/exynos-acpm-protocol.h | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-)
drivers/clk/samsung/Kconfig +1 -1
@@ -97,7 +97,7 @@ config EXYNOS_CLKOUT config EXYNOS_ACPM_CLK tristate "Clock driver controlled via ACPM interface" - depends on EXYNOS_ACPM_PROTOCOL || (COMPILE_TEST && !EXYNOS_ACPM_PROTOCOL) + depends on EXYNOS_ACPM_PROTOCOL help This driver provides support for clocks that are controlled by firmware that implements the ACPM interface.
include/linux/firmware/samsung/exynos-acpm-protocol.h +0 -14
@@ -68,22 +68,8 @@ struct acpm_handle {struct device ; -#if IS_ENABLED (CONFIG_EXYNOS_ACPM_PROTOCOL )struct acpm_handle *devm_acpm_get_by_node (struct device *dev,struct device_node *np);struct acpm_handle *devm_acpm_get_by_phandle (struct device *dev); -#else - -static inline struct acpm_handle *devm_acpm_get_by_node (struct device *dev, -struct device_node *np) -{ -return ERR_PTR (-ENODEV ); -} - -static inline struct acpm_handle *devm_acpm_get_by_phandle (struct device *dev) -{ -return ERR_PTR (-ENODEV ); -} -#endif #endif /* __EXYNOS_ACPM_PROTOCOL_H */
Signature · 1 line
2.39.5
Quoted 10 lines · Arnd Bergmann
Sashiko reported an inconsistent use of NULL vs
ERR_PTR()returns in the stub helpers inxynos-acpm-protocol.h.Since this only happens on dead code for COMPILE_TEST=y, this is not really a bug though. Having stub functions that return NULL is a common way to define optional interfaces, where callers still work when the feature is disabled, though this clearly does not work for acpm because some callers have a NULL pointer dereference when compile testing.
[...]
Applied, thanks!
[1/1] firmware: samsung: acpm: remove compile-testing stubs
https://git.kernel.org/krzk/linux/c/7b661285aa7507eab79efff0a418445157db4141
Best regards,
Signature · 1 line
Krzysztof Kozlowski <[email protected]>