firmware: imx: remove duplicate scmi_imx_misc_ctrl_get()
PATCH 1/1 firmware: imx: remove duplicate scmi_imx_misc_ctrl_get()
From: Arnd Bergmann <[email protected]>
These two functions have a stub definition when CONFIG_IMX_SCMI_MISC_EXT is not set, which conflict with the global definition:
In file included from drivers/firmware/imx/sm-misc.c:6:include/linux/firmware/imx/sm.h:30:1: error: expected identifier or '(' before '{' token
30 | {
| ^
drivers/firmware/imx/sm-misc.c:26:5: error: redefinition of 'scmi_imx_misc_ctrl_get'
26 | int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val)
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/firmware/imx/sm.h:24:19: note: previous definition of 'scmi_imx_misc_ctrl_get' with type 'int(u32, u32 *, u32 *)' {aka 'int(unsigned int, unsigned int *, unsigned int *)'}
24 | static inline int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val)
| ^~~~~~~~~~~~~~~~~~~~~~There is no real need for the #ifdef, and removing this avoids the build failure.
--- include/linux/firmware/imx/sm.h | 11 ----------- 1 file changed, 11 deletions(-)
include/linux/firmware/imx/sm.h +0 -11
@@ -17,18 +17,7 @@#define SCMI_IMX_CTRL_SAI4_MCLK 4/* WAKE SAI4 MCLK */ #define SCMI_IMX_CTRL_SAI5_MCLK 5/* WAKE SAI5 MCLK */ -#if IS_ENABLED (CONFIG_IMX_SCMI_MISC_EXT )int scmi_imx_misc_ctrl_get (u32 id,u32 *num,u32 *val);int scmi_imx_misc_ctrl_set (u32 id,u32 val); -#else -static inline int scmi_imx_misc_ctrl_get (u32 id,u32 *num,u32 *val) -{ -return -EOPNOTSUPP ; -} -static inline int scmi_imx_misc_ctrl_set (u32 id,u32 val); -{ -return -EOPNOTSUPP ; -} -#endif #endif
Signature · 1 line
2.39.2
Hi Arnd,
Quoted 45 lines
Subject: [PATCH] firmware: imx: remove duplicate
scmi_imx_misc_ctrl_get()From: Arnd Bergmann <[email protected]>
These two functions have a stub definition when
CONFIG_IMX_SCMI_MISC_EXTis not set, which conflict with the global definition:In file included from
drivers/firmware/imx/sm-misc.c:6:include/linux/firmware/imx/sm.h:30:1: error: expected identifier or '(' before '{' token30 | { | ^ drivers/firmware/imx/sm-misc.c:26:5: error: redefinition of 'scmi_imx_misc_ctrl_get' 26 | int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val) | ^~~~~~~~~~~~~~~~~~~~~~
include/linux/firmware/imx/sm.h:24:19: note: previous definition of 'scmi_imx_misc_ctrl_get' with type 'int(u32, u32 *, u32 *)' {aka 'int(unsigned int, unsigned int *, unsigned int *)'}
24 | static inline int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32
*val)| ^~~~~~~~~~~~~~~~~~~~~~There is no real need for the #ifdef, and removing this avoids the build failure.
Fixes 0b4f8a68b292 ("firmware: imx: Add i.MX95 MISC driver")Signed-off-by Arnd Bergmann <[email protected]>--- include/linux/firmware/imx/sm.h | 11 ----------- 1 file changed, 11 deletions(-)(quoted diff) +0
-0
b/include/linux/firmware/imx/sm.hindex62a2690e2abd..9b85a3f028d1100644include/linux/firmware/imx/sm.h +0
-0@@ -17,18 +17,7 @@#define SCMI_IMX_CTRL_SAI4_MCLK 4/* WAKE SAI4 MCLK */
#defineSCMI_IMX_CTRL_SAI5_MCLK5 /* WAKE
SAI5 MCLK */
Quoted 1 line
-#if
IS_ENABLED(CONFIG_IMX_SCMI_MISC_EXT)
Thanks for spotting this. But I think this macro
should be replaced with CONFIG_IMX_SCMI_MISC_DRV.
CONFIG_IMX_SCMI_MISC_DRV is the macro to guard the driver. CONFIG_IMX_SCMI_MISC_EXT is the macro to guard the scmi protocol.
So just need to use CONFIG_IMX_SCMI_MISC_DRV here should be ok.
Thanks,
Peng.
Quoted 13 lines
int
scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val); intscmi_imx_misc_ctrl_set(u32 id, u32 val); -#else -static inline intscmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val)-{include/linux/firmware/imx/sm.h +0
-7-return -EOPNOTSUPP ; -} -static inline int scmi_imx_misc_ctrl_set(u32 id, u32 val); -{ -return -EOPNOTSUPP ; -} -#endif #endif --2.39.2
This patch was applied to soc/soc.git (for-next) by Arnd Bergmann <[email protected]>:
Hello:
This patch was applied to soc/soc.git (for-next)
by Arnd Bergmann <[email protected]>:
Quoted 16 lines · On Mon, 9 Sep 2024 20:30:18 +0000 you wrote:
From: Arnd Bergmann <[email protected]>
These two functions have a stub definition when
CONFIG_IMX_SCMI_MISC_EXTis not set, which conflict with the global definition:In file included from
drivers/firmware/imx/sm-misc.c:6:include/linux/firmware/imx/sm.h:30:1: error: expected identifier or '(' before '{' token30 | { | ^ drivers/firmware/imx/sm-misc.c:26:5: error: redefinition of 'scmi_imx_misc_ctrl_get' 26 | int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val) | ^~~~~~~~~~~~~~~~~~~~~~ include/linux/firmware/imx/sm.h:24:19: note: previous definition of 'scmi_imx_misc_ctrl_get' with type 'int(u32, u32 *, u32 *)' {aka 'int(unsigned int, unsigned int *, unsigned int *)'} 24 | static inline int scmi_imx_misc_ctrl_get(u32 id, u32 *num, u32 *val) | ^~~~~~~~~~~~~~~~~~~~~~
Quoted 1 line
[...]
Here is the summary with links:
- firmware: imx: remove duplicate scmi_imx_misc_ctrl_get()
https://git.kernel.org/soc/soc/c/540c830212ed
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html