On 07/05/2025 09:25, Patrice Chotard wrote:
In case CONFIG_STM32_FIREWALL is not set, prototype are not visible which leads to following errors when enabling, for example, COMPILE_TEST and STM32_OMM:
stm32_firewall_device.h:117:5: error: no previous prototype for ‘stm32_firewall_get_firewall’ [-Werror=missing-prototypes] 117 | int stm32_firewall_get_firewall(struct device_node *np, struct stm32_firewall *firewall, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/bus/stm32_firewall_device.h:123:5: error: no previous prototype for ‘stm32_firewall_grant_access’ [-Werror=missing-prototypes] 123 | int stm32_firewall_grant_access(struct stm32_firewall *firewall) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/bus/stm32_firewall_device.h:128:6: error: no previous prototype for ‘stm32_firewall_release_access’ [-Werror=missing-prototypes] 128 | void stm32_firewall_release_access(struct stm32_firewall *firewall) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/bus/stm32_firewall_device.h:132:5: error: no previous prototype for ‘stm32_firewall_grant_access_by_id’ [-Werror=missing-prototypes] 132 | int stm32_firewall_grant_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/bus/stm32_firewall_device.h:137:6: error: no previous prototype for ‘stm32_firewall_release_access_by_id’ [-Werror=missing-prototypes] 137 | void stm32_firewall_release_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Make prototypes always exposed to fix this issue.
Cc: stable@vger.kernel.org Fixes: 5c9668cfc6d7 ("firewall: introduce stm32_firewall framework")
Signed-off-by: Patrice Chotard patrice.chotard@foss.st.com
include/linux/bus/stm32_firewall_device.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/linux/bus/stm32_firewall_device.h b/include/linux/bus/stm32_firewall_device.h index 5178b72bc920986bb6c55887453d146f382a8e77..ba6ef4468a0a8dfeb3e146ec90502e2f35172edc 100644 --- a/include/linux/bus/stm32_firewall_device.h +++ b/include/linux/bus/stm32_firewall_device.h @@ -35,7 +35,6 @@ struct stm32_firewall { u32 firewall_id; }; -#if IS_ENABLED(CONFIG_STM32_FIREWALL) /**
- stm32_firewall_get_firewall - Get the firewall(s) associated to given device.
The firewall controller reference is always the first argument
@@ -112,6 +111,15 @@ int stm32_firewall_grant_access_by_id(struct stm32_firewall *firewall, u32 subsy */ void stm32_firewall_release_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id); +#if IS_ENABLED(CONFIG_STM32_FIREWALL)
+extern int stm32_firewall_get_firewall(struct device_node *np, struct stm32_firewall *firewall,
unsigned int nb_firewall);
That's duplicated with earlier declaration. If you need to duplicate declarations means your code is not correct. That's not a fix at all and you are again masking the real problem which I asked to understand and learn.
This is something solved already in all other common interfaces (ones with stubs) and it confuses me why here it takes so much time. I'll just fix it myself and I will apply v11.
Best regards, Krzysztof