[PATCH v13 1/4] firewall: Always expose firewall prototype
Patrice Chotard
patrice.chotard at foss.st.com
Wed May 7 00:25:14 PDT 2025
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 at vger.kernel.org>
Fixes: 5c9668cfc6d7 ("firewall: introduce stm32_firewall framework")
Signed-off-by: Patrice Chotard <patrice.chotard at 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);
+extern int stm32_firewall_grant_access(struct stm32_firewall *firewall);
+extern void stm32_firewall_release_access(struct stm32_firewall *firewall);
+extern int stm32_firewall_grant_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id);
+extern void stm32_firewall_release_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id);
+
#else /* CONFIG_STM32_FIREWALL */
int stm32_firewall_get_firewall(struct device_node *np, struct stm32_firewall *firewall,
--
2.25.1
More information about the linux-arm-kernel
mailing list