lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 7 Sep 2021 18:58:38 +0200
From:   Thierry Reding <thierry.reding@...il.com>
To:     Guenter Roeck <linux@...ck-us.net>
Cc:     Laxman Dewangan <ldewangan@...dia.com>,
        Mark Brown <broonie@...nel.org>,
        Jonathan Hunter <jonathanh@...dia.com>,
        linux-spi@...r.kernel.org, linux-tegra@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] spi: tegra20-slink: Declare runtime suspend and resume
 functions conditionally

On Mon, Sep 06, 2021 at 09:53:58PM -0700, Guenter Roeck wrote:
> The following build error is seen with CONFIG_PM=n.
> 
> drivers/spi/spi-tegra20-slink.c:1188:12: error:
> 	'tegra_slink_runtime_suspend' defined but not used
> drivers/spi/spi-tegra20-slink.c:1200:12: error:
> 	'tegra_slink_runtime_resume' defined but not used
> 
> Declare the functions only if PM is enabled. While at it, remove the
> unnecessary forward declarations.
> 
> Signed-off-by: Guenter Roeck <linux@...ck-us.net>
> ---
>  drivers/spi/spi-tegra20-slink.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
> index ebd27f883033..8ce840c7ecc8 100644
> --- a/drivers/spi/spi-tegra20-slink.c
> +++ b/drivers/spi/spi-tegra20-slink.c
> @@ -204,9 +204,6 @@ struct tegra_slink_data {
>  	struct dma_async_tx_descriptor		*tx_dma_desc;
>  };
>  
> -static int tegra_slink_runtime_suspend(struct device *dev);
> -static int tegra_slink_runtime_resume(struct device *dev);
> -
>  static inline u32 tegra_slink_readl(struct tegra_slink_data *tspi,
>  		unsigned long reg)
>  {
> @@ -1185,6 +1182,7 @@ static int tegra_slink_resume(struct device *dev)
>  }
>  #endif
>  
> +#ifdef CONFIG_PM
>  static int tegra_slink_runtime_suspend(struct device *dev)
>  {
>  	struct spi_master *master = dev_get_drvdata(dev);
> @@ -1210,6 +1208,7 @@ static int tegra_slink_runtime_resume(struct device *dev)
>  	}
>  	return 0;
>  }
> +#endif /* CONFIG_PM */
>  
>  static const struct dev_pm_ops slink_pm_ops = {
>  	SET_RUNTIME_PM_OPS(tegra_slink_runtime_suspend,

Looks like this is mostly leftover from commit e4bb903fda0e ("spi:
tegra20-slink: Improve runtime PM usage"). That's likely going to go
into v5.15 since it's been in linux-next for a couple of weeks, so this
one should go there as well.

But yeah, looks correct. On a side-note: ARCH_TEGRA always selects PM,
so we typically assume that these guards are not needed. However, since
SPI's Kconfig has these two symbols || COMPILE_TEST, that assumption is
obviously no longer true.

Anyway, this looks correct, so:

Acked-by: Thierry Reding <treding@...dia.com>

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ