Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Patrice Chotard <patrice.chotard@foss.st.com>,
	Rob Herring <robh@kernel.org>, Conor Dooley <conor+dt@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Gatien Chevallier <gatien.chevallier@foss.st.com>
Cc: christophe.kerello@foss.st.com, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org
Subject: Re: [PATCH v13 1/4] firewall: Always expose firewall prototype
Date: Wed, 7 May 2025 11:22:49 +0200	[thread overview]
Message-ID: <7b344f05-70b6-4c59-9b5f-611dde59c09b@kernel.org> (raw)
In-Reply-To: <20250507-upstream_ospi_v6-v13-1-32290b21419a@foss.st.com>

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


  reply	other threads:[~2025-05-07  9:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-07  7:25 [PATCH v13 0/4] Add STM32MP25 SPI NOR support Patrice Chotard
2025-05-07  7:25 ` [PATCH v13 1/4] firewall: Always expose firewall prototype Patrice Chotard
2025-05-07  9:22   ` Krzysztof Kozlowski [this message]
2025-05-07  7:25 ` [PATCH v13 2/4] dt-bindings: memory-controllers: Add STM32 Octo Memory Manager controller Patrice Chotard
2025-05-07  7:25 ` [PATCH v13 3/4] memory: Add STM32 Octo Memory Manager driver Patrice Chotard
2025-05-07  7:25 ` [PATCH v13 4/4] MAINTAINERS: add entry for STM32 OCTO MEMORY MANAGER driver Patrice Chotard
2025-05-07  8:28 ` [PATCH v13 0/4] Add STM32MP25 SPI NOR support Krzysztof Kozlowski
2025-05-07  8:31   ` Patrice CHOTARD
2025-05-07  8:35   ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7b344f05-70b6-4c59-9b5f-611dde59c09b@kernel.org \
    --to=krzk@kernel.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=catalin.marinas@arm.com \
    --cc=christophe.kerello@foss.st.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gatien.chevallier@foss.st.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=patrice.chotard@foss.st.com \
    --cc=robh@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox