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]
Message-ID: <CAA+hA=RPKfRgDc-SesHR8pBFwo0fsbYT=sY=QYyqiAV7U=k_hA@mail.gmail.com>
Date:	Tue, 26 Jul 2016 21:41:50 +0800
From:	Dong Aisheng <dongas86@...il.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	Adrian Hunter <adrian.hunter@...el.com>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	Dong Aisheng <aisheng.dong@....com>,
	Haibo Chen <haibo.chen@...escale.com>,
	"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mmc: sdhci-esdhc-imx: avoid unused function warnings

Hi Arnd,

On Tue, Jul 26, 2016 at 8:32 PM, Arnd Bergmann <arnd@...db.de> wrote:
> The driver has just gained a slightly incorrect pm-sleep implementation that causes
> warnings when CONFIG_PM is set but CONFIG_PM_SLEEP is not:
>
> drivers/mmc/host/sdhci-esdhc-imx.c:1302:12: error: 'sdhci_esdhc_resume' defined but not used [-Werror=unused-function]
>  static int sdhci_esdhc_resume(struct device *dev)
>             ^~~~~~~~~~~~~~~~~~
> drivers/mmc/host/sdhci-esdhc-imx.c:1297:12: error: 'sdhci_esdhc_suspend' defined but not used [-Werror=unused-function]
>  static int sdhci_esdhc_suspend(struct device *dev)
>
> This replaces the incorrect #ifdef with a __maybe_unused annotation that does
> the right thing in all configurations and is more readable.
>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> Fixes: b70d0b3b5b29 ("mmc: sdhci-esdhc-imx: add esdhc specific suspend resume callback")

Thanks for the fix.
Looks like the default kernel Makefile does not enable
-Werror=unused-function wanrings,
so did not expose it before.

Acked-by: Dong Aisheng <aisheng.dong@....com>

Regards
Dong Aisheng

> ---
>  drivers/mmc/host/sdhci-esdhc-imx.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index 2bb326bbc34a..593e34053c4b 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -1293,13 +1293,12 @@ static int sdhci_esdhc_imx_remove(struct platform_device *pdev)
>         return 0;
>  }
>
> -#ifdef CONFIG_PM
> -static int sdhci_esdhc_suspend(struct device *dev)
> +static int __maybe_unused sdhci_esdhc_suspend(struct device *dev)
>  {
>         return sdhci_pltfm_suspend(dev);
>  }
>
> -static int sdhci_esdhc_resume(struct device *dev)
> +static int __maybe_unused sdhci_esdhc_resume(struct device *dev)
>  {
>         struct sdhci_host *host = dev_get_drvdata(dev);
>
> @@ -1309,7 +1308,7 @@ static int sdhci_esdhc_resume(struct device *dev)
>         return sdhci_pltfm_resume(dev);
>  }
>
> -static int sdhci_esdhc_runtime_suspend(struct device *dev)
> +static int __maybe_unused sdhci_esdhc_runtime_suspend(struct device *dev)
>  {
>         struct sdhci_host *host = dev_get_drvdata(dev);
>         struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> @@ -1327,7 +1326,7 @@ static int sdhci_esdhc_runtime_suspend(struct device *dev)
>         return ret;
>  }
>
> -static int sdhci_esdhc_runtime_resume(struct device *dev)
> +static int __maybe_unused sdhci_esdhc_runtime_resume(struct device *dev)
>  {
>         struct sdhci_host *host = dev_get_drvdata(dev);
>         struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> @@ -1341,7 +1340,6 @@ static int sdhci_esdhc_runtime_resume(struct device *dev)
>
>         return sdhci_runtime_resume_host(host);
>  }
> -#endif
>
>  static const struct dev_pm_ops sdhci_esdhc_pmops = {
>         SET_SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend, sdhci_esdhc_resume)
> --
> 2.9.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ