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: <7b5fcb3e-e3e7-4d87-9a7b-5570e2e85a0e@intel.com>
Date: Mon, 9 Dec 2024 12:38:59 +0200
From: Adrian Hunter <adrian.hunter@...el.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
 Ulf Hansson <ulf.hansson@...aro.org>,
 Victor Shih <victor.shih@...esyslogic.com.tw>, linux-mmc@...r.kernel.org,
 linux-kernel@...r.kernel.org, Linux PM list <linux-pm@...r.kernel.org>,
 "Rafael J. Wysocki" <rafael@...nel.org>
Subject: Re: [PATCH v2 1/6] mmc: sdhci: Use EXPORT_PM_FN_NS_GPL() for
 exporting PM functions

On 1/11/24 12:11, Andy Shevchenko wrote:
> Switch from ugly ifdeffery to using EXPORT_PM_FN_NS_GPL()
> for exporting PM functions. This helps cleaning up the other
> SDHCI drivers in the future.

It seems sdhci is the first code in the kernel to use
EXPORT_PM_FN_NS_GPL() but it was not asked for ;-)

As such, can you fill in a little background.  I am not
sure what it achieves.  Why have CONFIG_PM if not to
#ifdef dependent code behind it?

> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  drivers/mmc/host/sdhci.c | 14 ++++----------
>  drivers/mmc/host/sdhci.h |  2 --
>  2 files changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index f4a7733a8ad2..2214280ca5fb 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -3733,8 +3733,6 @@ EXPORT_SYMBOL_GPL(sdhci_thread_irq);
>   *                                                                           *
>  \*****************************************************************************/
>  
> -#ifdef CONFIG_PM
> -
>  static bool sdhci_cd_irq_can_wakeup(struct sdhci_host *host)
>  {
>  	return mmc_card_is_removable(host->mmc) &&
> @@ -3814,8 +3812,7 @@ int sdhci_suspend_host(struct sdhci_host *host)
>  
>  	return 0;
>  }
> -
> -EXPORT_SYMBOL_GPL(sdhci_suspend_host);
> +EXPORT_PM_FN_GPL(sdhci_suspend_host);
>  
>  int sdhci_resume_host(struct sdhci_host *host)
>  {
> @@ -3853,8 +3850,7 @@ int sdhci_resume_host(struct sdhci_host *host)
>  
>  	return ret;
>  }
> -
> -EXPORT_SYMBOL_GPL(sdhci_resume_host);
> +EXPORT_PM_FN_GPL(sdhci_resume_host);
>  
>  int sdhci_runtime_suspend_host(struct sdhci_host *host)
>  {
> @@ -3876,7 +3872,7 @@ int sdhci_runtime_suspend_host(struct sdhci_host *host)
>  
>  	return 0;
>  }
> -EXPORT_SYMBOL_GPL(sdhci_runtime_suspend_host);
> +EXPORT_PM_FN_GPL(sdhci_runtime_suspend_host);
>  
>  int sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset)
>  {
> @@ -3927,9 +3923,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset)
>  
>  	return 0;
>  }
> -EXPORT_SYMBOL_GPL(sdhci_runtime_resume_host);
> -
> -#endif /* CONFIG_PM */
> +EXPORT_PM_FN_GPL(sdhci_runtime_resume_host);
>  
>  /*****************************************************************************\
>   *                                                                           *
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index cd0e35a80542..4ee2695b0202 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -874,12 +874,10 @@ irqreturn_t sdhci_thread_irq(int irq, void *dev_id);
>  void sdhci_adma_write_desc(struct sdhci_host *host, void **desc,
>  			   dma_addr_t addr, int len, unsigned int cmd);
>  
> -#ifdef CONFIG_PM
>  int sdhci_suspend_host(struct sdhci_host *host);
>  int sdhci_resume_host(struct sdhci_host *host);
>  int sdhci_runtime_suspend_host(struct sdhci_host *host);
>  int sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset);
> -#endif
>  
>  void sdhci_cqe_enable(struct mmc_host *mmc);
>  void sdhci_cqe_disable(struct mmc_host *mmc, bool recovery);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ