[PATCH] bus: firewall: Fix missing static inline annotations for stubs

Krzysztof Kozlowski posted 1 patch 7 months, 1 week ago
include/linux/bus/stm32_firewall_device.h | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
[PATCH] bus: firewall: Fix missing static inline annotations for stubs
Posted by Krzysztof Kozlowski 7 months, 1 week ago
Stubs in the header file for !CONFIG_STM32_FIREWALL case should be both
static and inline, because they do not come with earlier declaration and
should be inlined in every unit including the header.

Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: <stable@vger.kernel.org>
Fixes: 5c9668cfc6d7 ("firewall: introduce stm32_firewall framework")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 include/linux/bus/stm32_firewall_device.h | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/include/linux/bus/stm32_firewall_device.h b/include/linux/bus/stm32_firewall_device.h
index 5178b72bc920..eaa7a3f54450 100644
--- a/include/linux/bus/stm32_firewall_device.h
+++ b/include/linux/bus/stm32_firewall_device.h
@@ -114,27 +114,30 @@ void stm32_firewall_release_access_by_id(struct stm32_firewall *firewall, u32 su
 
 #else /* CONFIG_STM32_FIREWALL */
 
-int stm32_firewall_get_firewall(struct device_node *np, struct stm32_firewall *firewall,
-				unsigned int nb_firewall)
+static inline int stm32_firewall_get_firewall(struct device_node *np,
+					      struct stm32_firewall *firewall,
+					      unsigned int nb_firewall)
 {
 	return -ENODEV;
 }
 
-int stm32_firewall_grant_access(struct stm32_firewall *firewall)
+static inline int stm32_firewall_grant_access(struct stm32_firewall *firewall)
 {
 	return -ENODEV;
 }
 
-void stm32_firewall_release_access(struct stm32_firewall *firewall)
+static inline void stm32_firewall_release_access(struct stm32_firewall *firewall)
 {
 }
 
-int stm32_firewall_grant_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id)
+static inline int stm32_firewall_grant_access_by_id(struct stm32_firewall *firewall,
+						    u32 subsystem_id)
 {
 	return -ENODEV;
 }
 
-void stm32_firewall_release_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id)
+static inline void stm32_firewall_release_access_by_id(struct stm32_firewall *firewall,
+						       u32 subsystem_id)
 {
 }
 
-- 
2.45.2
Re: [PATCH] bus: firewall: Fix missing static inline annotations for stubs
Posted by Krzysztof Kozlowski 7 months, 1 week ago
On Wed, 07 May 2025 11:21:22 +0200, Krzysztof Kozlowski wrote:
> Stubs in the header file for !CONFIG_STM32_FIREWALL case should be both
> static and inline, because they do not come with earlier declaration and
> should be inlined in every unit including the header.
> 
> 

Applied, thanks!

[1/1] bus: firewall: Fix missing static inline annotations for stubs
      https://git.kernel.org/krzk/linux-mem-ctrl/c/66db876162155c1cec87359cd78c62aaafde9257

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Re: [PATCH] bus: firewall: Fix missing static inline annotations for stubs
Posted by Patrice CHOTARD 7 months, 1 week ago

On 5/7/25 11:21, Krzysztof Kozlowski wrote:
> Stubs in the header file for !CONFIG_STM32_FIREWALL case should be both
> static and inline, because they do not come with earlier declaration and
> should be inlined in every unit including the header.
> 
> Cc: Patrice Chotard <patrice.chotard@foss.st.com>
> Cc: <stable@vger.kernel.org>
> Fixes: 5c9668cfc6d7 ("firewall: introduce stm32_firewall framework")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  include/linux/bus/stm32_firewall_device.h | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/include/linux/bus/stm32_firewall_device.h b/include/linux/bus/stm32_firewall_device.h
> index 5178b72bc920..eaa7a3f54450 100644
> --- a/include/linux/bus/stm32_firewall_device.h
> +++ b/include/linux/bus/stm32_firewall_device.h
> @@ -114,27 +114,30 @@ void stm32_firewall_release_access_by_id(struct stm32_firewall *firewall, u32 su
>  
>  #else /* CONFIG_STM32_FIREWALL */
>  
> -int stm32_firewall_get_firewall(struct device_node *np, struct stm32_firewall *firewall,
> -				unsigned int nb_firewall)
> +static inline int stm32_firewall_get_firewall(struct device_node *np,
> +					      struct stm32_firewall *firewall,
> +					      unsigned int nb_firewall)
>  {
>  	return -ENODEV;
>  }
>  
> -int stm32_firewall_grant_access(struct stm32_firewall *firewall)
> +static inline int stm32_firewall_grant_access(struct stm32_firewall *firewall)
>  {
>  	return -ENODEV;
>  }
>  
> -void stm32_firewall_release_access(struct stm32_firewall *firewall)
> +static inline void stm32_firewall_release_access(struct stm32_firewall *firewall)
>  {
>  }
>  
> -int stm32_firewall_grant_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id)
> +static inline int stm32_firewall_grant_access_by_id(struct stm32_firewall *firewall,
> +						    u32 subsystem_id)
>  {
>  	return -ENODEV;
>  }
>  
> -void stm32_firewall_release_access_by_id(struct stm32_firewall *firewall, u32 subsystem_id)
> +static inline void stm32_firewall_release_access_by_id(struct stm32_firewall *firewall,
> +						       u32 subsystem_id)
>  {
>  }
>  
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice