Skip to contentSkip to conversation

platform/x86/amd/hsmp: Use IS_ENABLED() instead of IS_REACHABLE()

PATCH In review Suma Hegde 2 participants 2 messages Jun 3, 2025 – Jun 9, 2025

Subsystems (2)
lore
Share & tools
lore

Suma Hegde

author
#0 lore raw

PATCH 1/1 platform/x86/amd/hsmp: Use IS_ENABLED() instead of IS_REACHABLE()

IS_REACHABLE() was required when CONFIG_HWMON was set to m and HSMP to y. However, commit 69157b00b526 ("platform/x86/amd/hsmp: fix building with CONFIG_HWMON=m") added a HWMON dependency for HSMP in Kconfig. With this change, using IS_ENABLED() is sufficient.

Add the missing header file as well.

---
 drivers/platform/x86/amd/hsmp/hsmp.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/x86/amd/hsmp/hsmp.h +2 -1
index 36b5ceea9ac0..0509a442eaae 100644
@@ -13,6 +13,7 @@
 #include <linux/compiler_types.h>
 #include <linux/device.h>
 #include <linux/hwmon.h>
+#include <linux/kconfig.h>
 #include <linux/miscdevice.h>
 #include <linux/pci.h>
 #include <linux/semaphore.h>
@@ -64,7 +65,7 @@ int hsmp_misc_register(struct device *dev);
 int hsmp_get_tbl_dram_base(u16 sock_ind);
 ssize_t hsmp_metric_tbl_read(struct hsmp_socket *sock, char *buf, size_t size);
 struct hsmp_plat_device *get_hsmp_pdev(void);
-#if IS_REACHABLE(CONFIG_HWMON)
+#if IS_ENABLED(CONFIG_HWMON)
 int hsmp_create_sensor(struct device *dev, u16 sock_ind);
 #else
 static inline int hsmp_create_sensor(struct device *dev, u16 sock_ind) { return 0; }
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 8 lines · Suma Hegde

IS_REACHABLE() was required when CONFIG_HWMON was set to m and HSMP to y. However, commit 69157b00b526 ("platform/x86/amd/hsmp: fix building with CONFIG_HWMON=m") added a HWMON dependency for HSMP in Kconfig. With this change, using IS_ENABLED() is sufficient.

Add the missing header file as well.

[...]

Thank you for your contribution, it has been applied to my local review-ilpo-next branch. Note it will show up in the public platform-drivers-x86/review-ilpo-next branch only once I've pushed my local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86/amd/hsmp: Use IS_ENABLED() instead of IS_REACHABLE()

      commit: e7c1a9e8d33ceb44ef088de7a9112a1db94d13a4

--
i.