mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Ren Zhijie <renzhijie2@huawei.com>,
	ulf.hansson@linaro.org, reniuschengl@gmail.com,
	jasonlai.genesyslogic@gmail.com
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] mmc: sdhci-pci-gli: Fix build error unused-function
Date: Wed, 22 Jun 2022 11:58:11 +0300	[thread overview]
Message-ID: <569cc212-d1b1-d433-1f61-f94bf8037251@intel.com> (raw)
In-Reply-To: <20220619104712.125364-1-renzhijie2@huawei.com>

On 19/06/22 13:47, Ren Zhijie wrote:
> If CONFIG_PM is not set.
> 
> make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu-, will be failed, like this:
> 
> drivers/mmc/host/sdhci-pci-gli.c:834:13: error: ‘gl9763e_set_low_power_negotiation’ defined but not used [-Werror=unused-function]
>  static void gl9763e_set_low_power_negotiation(struct sdhci_pci_slot *slot, bool enable)
>              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> make[3]: *** [drivers/mmc/host/sdhci-pci-gli.o] Error 1
> 
> To fix building warning, wrap all related code with CONFIG_PM.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Fixes: 78fe993ae714("mmc: host: Improve I/O read/write performance for GL9763E")
> Signed-off-by: Ren Zhijie <renzhijie2@huawei.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/sdhci-pci-gli.c | 50 ++++++++++++++++----------------
>  1 file changed, 25 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pci-gli.c b/drivers/mmc/host/sdhci-pci-gli.c
> index a76506adc206..4d509f656188 100644
> --- a/drivers/mmc/host/sdhci-pci-gli.c
> +++ b/drivers/mmc/host/sdhci-pci-gli.c
> @@ -831,31 +831,6 @@ static void sdhci_gl9763e_dumpregs(struct mmc_host *mmc)
>  	sdhci_dumpregs(mmc_priv(mmc));
>  }
>  
> -static void gl9763e_set_low_power_negotiation(struct sdhci_pci_slot *slot, bool enable)
> -{
> -	struct pci_dev *pdev = slot->chip->pdev;
> -	u32 value;
> -
> -	pci_read_config_dword(pdev, PCIE_GLI_9763E_VHS, &value);
> -	value &= ~GLI_9763E_VHS_REV;
> -	value |= FIELD_PREP(GLI_9763E_VHS_REV, GLI_9763E_VHS_REV_W);
> -	pci_write_config_dword(pdev, PCIE_GLI_9763E_VHS, value);
> -
> -	pci_read_config_dword(pdev, PCIE_GLI_9763E_CFG, &value);
> -
> -	if (enable)
> -		value &= ~GLI_9763E_CFG_LPSN_DIS;
> -	else
> -		value |= GLI_9763E_CFG_LPSN_DIS;
> -
> -	pci_write_config_dword(pdev, PCIE_GLI_9763E_CFG, value);
> -
> -	pci_read_config_dword(pdev, PCIE_GLI_9763E_VHS, &value);
> -	value &= ~GLI_9763E_VHS_REV;
> -	value |= FIELD_PREP(GLI_9763E_VHS_REV, GLI_9763E_VHS_REV_R);
> -	pci_write_config_dword(pdev, PCIE_GLI_9763E_VHS, value);
> -}
> -
>  static void sdhci_gl9763e_cqe_pre_enable(struct mmc_host *mmc)
>  {
>  	struct cqhci_host *cq_host = mmc->cqe_private;
> @@ -991,6 +966,31 @@ static void gli_set_gl9763e(struct sdhci_pci_slot *slot)
>  }
>  
>  #ifdef CONFIG_PM
> +static void gl9763e_set_low_power_negotiation(struct sdhci_pci_slot *slot, bool enable)
> +{
> +	struct pci_dev *pdev = slot->chip->pdev;
> +	u32 value;
> +
> +	pci_read_config_dword(pdev, PCIE_GLI_9763E_VHS, &value);
> +	value &= ~GLI_9763E_VHS_REV;
> +	value |= FIELD_PREP(GLI_9763E_VHS_REV, GLI_9763E_VHS_REV_W);
> +	pci_write_config_dword(pdev, PCIE_GLI_9763E_VHS, value);
> +
> +	pci_read_config_dword(pdev, PCIE_GLI_9763E_CFG, &value);
> +
> +	if (enable)
> +		value &= ~GLI_9763E_CFG_LPSN_DIS;
> +	else
> +		value |= GLI_9763E_CFG_LPSN_DIS;
> +
> +	pci_write_config_dword(pdev, PCIE_GLI_9763E_CFG, value);
> +
> +	pci_read_config_dword(pdev, PCIE_GLI_9763E_VHS, &value);
> +	value &= ~GLI_9763E_VHS_REV;
> +	value |= FIELD_PREP(GLI_9763E_VHS_REV, GLI_9763E_VHS_REV_R);
> +	pci_write_config_dword(pdev, PCIE_GLI_9763E_VHS, value);
> +}
> +
>  static int gl9763e_runtime_suspend(struct sdhci_pci_chip *chip)
>  {
>  	struct sdhci_pci_slot *slot = chip->slots[0];


  reply	other threads:[~2022-06-22  9:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-19 10:47 Ren Zhijie
2022-06-22  8:58 ` Adrian Hunter [this message]
2022-06-23 12:07 ` Ulf Hansson

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=569cc212-d1b1-d433-1f61-f94bf8037251@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=jasonlai.genesyslogic@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=reniuschengl@gmail.com \
    --cc=renzhijie2@huawei.com \
    --cc=ulf.hansson@linaro.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

all inboxes | Powered by JetHome®