platform/x86/amd/hsmp: Declare hsmp_create_sensor() as static within #if clause
Subsystems (2)
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]/
Signed-off-by Suma Hegde <[email protected]>
Reviewed-by Naveen Krishna Chatradhi <[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
@@ -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
Ilpo Järvinen
maintainerQuoted 21 lines · Suma Hegde
To address the kernel test robot warning, declare
hsmp_create_sensor()as a static function whenCONFIG_HWMONis 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]/Signed-off-by Suma Hegde <[email protected]>Reviewed-by Naveen Krishna Chatradhi <[email protected]>---
This is rebased on review-ilpo-next branchdrivers/platform/x86/amd/hsmp/hsmp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/platform/x86/amd/hsmp/hsmp.h +0
-0
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.