Skip to contentSkip to conversation

platform/x86/amd/hsmp: Declare hsmp_create_sensor() as static within #if clause

PATCH In review Suma Hegde 2 participants 2 messages May 12, 2025

Subsystems (2)
lore
Share & tools
lore

Suma Hegde

author
#0 lore raw

PATCH 1/1 platform/x86/amd/hsmp: Declare hsmp_create_sensor() as static within #if clause

To address the kernel test robot warning, declare hsmp_create_sensor() as a static function when CONFIG_HWMON is either not defined or configured as a module (M).

| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

---
This is rebased on review-ilpo-next branch

 drivers/platform/x86/amd/hsmp/hsmp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/amd/hsmp/hsmp.h +1 -1
index 027db8e1de12..36b5ceea9ac0 100644
@@ -67,7 +67,7 @@ struct hsmp_plat_device *get_hsmp_pdev(void);
 #if IS_REACHABLE(CONFIG_HWMON)
 int hsmp_create_sensor(struct device *dev, u16 sock_ind);
 #else
-int hsmp_create_sensor(struct device *dev, u16 sock_ind) { return 0; }
+static inline int hsmp_create_sensor(struct device *dev, u16 sock_ind) { return 0; }
 #endif
 int hsmp_msg_get_nargs(u16 sock_ind, u32 msg_id, u32 *data, u8 num_args);
 #endif /* HSMP_H */
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 21 lines · Suma Hegde

To address the kernel test robot warning, declare hsmp_create_sensor() as a static function when CONFIG_HWMON is either not defined or configured as a module (M).

| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

---
This is rebased on review-ilpo-next branch

 drivers/platform/x86/amd/hsmp/hsmp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/amd/hsmp/hsmp.h +0 -0
index 027db8e1de12..36b5ceea9ac0 100644

drivers/platform/x86/amd/hsmp/hsmp.h struct hsmp_plat_device *get_hsmp_pdev(void); · line 73

Quoted 8 lines
drivers/platform/x86/amd/hsmp/hsmp.h +1 -1
@@ -67,7 +67,7 @@ struct hsmp_plat_device *get_hsmp_pdev(void);
 #if IS_REACHABLE(CONFIG_HWMON)
 int hsmp_create_sensor(struct device *dev, u16 sock_ind);
 #else
-int hsmp_create_sensor(struct device *dev, u16 sock_ind) { return 0; }
+static inline int hsmp_create_sensor(struct device *dev, u16 sock_ind) { return 0; }
 #endif
 int hsmp_msg_get_nargs(u16 sock_ind, u32 msg_id, u32 *data, u8 num_args);
 #endif /* HSMP_H */

Thanks, I made this change into the original commit before seeing this patch (but I'd have folded it into the original commit anyway).

Signature · 1 line
 i.