All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] mmc: remove set but not used variables 'len, clock_out'
@ 2018-12-07  6:34 YueHaibing
  2018-12-07 18:04 ` Oleksij Rempel
  2018-12-11  9:31 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2018-12-07  6:34 UTC (permalink / raw)
  To: kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/mmc/host/alcor.c: In function 'alcor_data_set_dma':
drivers/mmc/host/alcor.c:124:12: warning:
 variable 'len' set but not used [-Wunused-but-set-variable]

drivers/mmc/host/alcor.c:648:15: warning:
 variable 'clock_out' set but not used [-Wunused-but-set-variable]

It never used since introduction in commit 2a9a4742e825 ("mmc: add new Alcor
Micro Cardreader SD/MMC driver")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/mmc/host/alcor.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/mmc/host/alcor.c b/drivers/mmc/host/alcor.c
index f729a64..c712b7d 100644
--- a/drivers/mmc/host/alcor.c
+++ b/drivers/mmc/host/alcor.c
@@ -121,7 +121,7 @@ static void alcor_reset(struct alcor_sdmmc_host *host, u8 val)
 static void alcor_data_set_dma(struct alcor_sdmmc_host *host)
 {
 	struct alcor_pci_priv *priv = host->alcor_pci;
-	u32 addr, len;
+	u32 addr;
 
 	if (!host->sg_count)
 		return;
@@ -138,7 +138,6 @@ static void alcor_data_set_dma(struct alcor_sdmmc_host *host)
 
 
 	addr = (u32)sg_dma_address(host->sg);
-	len = sg_dma_len(host->sg);
 
 	alcor_write32(priv, addr, AU6601_REG_SDMA_ADDR);
 	host->sg = sg_next(host->sg);
@@ -645,7 +644,6 @@ static irqreturn_t alcor_irq(int irq, void *d)
 static void alcor_set_clock(struct alcor_sdmmc_host *host, unsigned int clock)
 {
 	struct alcor_pci_priv *priv = host->alcor_pci;
-	unsigned int clock_out = 0;
 	int i, diff = 0x7fffffff, tmp_clock = 0;
 	u16 clk_src = 0;
 	u8 clk_div = 0;
@@ -670,7 +668,6 @@ static void alcor_set_clock(struct alcor_sdmmc_host *host, unsigned int clock)
 			diff = tmp_diff;
 			clk_src = cfg->clk_src_reg;
 			clk_div = tmp_div;
-			clock_out = tmp_clock;
 		}
 	}
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] mmc: remove set but not used variables 'len, clock_out'
  2018-12-07  6:34 [PATCH -next] mmc: remove set but not used variables 'len, clock_out' YueHaibing
@ 2018-12-07 18:04 ` Oleksij Rempel
  2018-12-11  9:31 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Oleksij Rempel @ 2018-12-07 18:04 UTC (permalink / raw)
  To: kernel-janitors


[-- Attachment #1.1: Type: text/plain, Size: 2080 bytes --]

Am 07.12.18 um 07:34 schrieb YueHaibing:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/mmc/host/alcor.c: In function 'alcor_data_set_dma':
> drivers/mmc/host/alcor.c:124:12: warning:
>  variable 'len' set but not used [-Wunused-but-set-variable]
> 
> drivers/mmc/host/alcor.c:648:15: warning:
>  variable 'clock_out' set but not used [-Wunused-but-set-variable]
> 
> It never used since introduction in commit 2a9a4742e825 ("mmc: add new Alcor
> Micro Cardreader SD/MMC driver")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>


Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>

thanks!

> ---
>  drivers/mmc/host/alcor.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/host/alcor.c b/drivers/mmc/host/alcor.c
> index f729a64..c712b7d 100644
> --- a/drivers/mmc/host/alcor.c
> +++ b/drivers/mmc/host/alcor.c
> @@ -121,7 +121,7 @@ static void alcor_reset(struct alcor_sdmmc_host *host, u8 val)
>  static void alcor_data_set_dma(struct alcor_sdmmc_host *host)
>  {
>  	struct alcor_pci_priv *priv = host->alcor_pci;
> -	u32 addr, len;
> +	u32 addr;
>  
>  	if (!host->sg_count)
>  		return;
> @@ -138,7 +138,6 @@ static void alcor_data_set_dma(struct alcor_sdmmc_host *host)
>  
>  
>  	addr = (u32)sg_dma_address(host->sg);
> -	len = sg_dma_len(host->sg);
>  
>  	alcor_write32(priv, addr, AU6601_REG_SDMA_ADDR);
>  	host->sg = sg_next(host->sg);
> @@ -645,7 +644,6 @@ static irqreturn_t alcor_irq(int irq, void *d)
>  static void alcor_set_clock(struct alcor_sdmmc_host *host, unsigned int clock)
>  {
>  	struct alcor_pci_priv *priv = host->alcor_pci;
> -	unsigned int clock_out = 0;
>  	int i, diff = 0x7fffffff, tmp_clock = 0;
>  	u16 clk_src = 0;
>  	u8 clk_div = 0;
> @@ -670,7 +668,6 @@ static void alcor_set_clock(struct alcor_sdmmc_host *host, unsigned int clock)
>  			diff = tmp_diff;
>  			clk_src = cfg->clk_src_reg;
>  			clk_div = tmp_div;
> -			clock_out = tmp_clock;
>  		}
>  	}
>  
> 
> 
> 
> 
> 


-- 
Regards,
Oleksij


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] mmc: remove set but not used variables 'len, clock_out'
  2018-12-07  6:34 [PATCH -next] mmc: remove set but not used variables 'len, clock_out' YueHaibing
  2018-12-07 18:04 ` Oleksij Rempel
@ 2018-12-11  9:31 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2018-12-11  9:31 UTC (permalink / raw)
  To: kernel-janitors

On Fri, 7 Dec 2018 at 07:26, YueHaibing <yuehaibing@huawei.com> wrote:
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/mmc/host/alcor.c: In function 'alcor_data_set_dma':
> drivers/mmc/host/alcor.c:124:12: warning:
>  variable 'len' set but not used [-Wunused-but-set-variable]
>
> drivers/mmc/host/alcor.c:648:15: warning:
>  variable 'clock_out' set but not used [-Wunused-but-set-variable]
>
> It never used since introduction in commit 2a9a4742e825 ("mmc: add new Alcor
> Micro Cardreader SD/MMC driver")
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied for next, thanks!

Kind regards
Uffe

> ---
>  drivers/mmc/host/alcor.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/host/alcor.c b/drivers/mmc/host/alcor.c
> index f729a64..c712b7d 100644
> --- a/drivers/mmc/host/alcor.c
> +++ b/drivers/mmc/host/alcor.c
> @@ -121,7 +121,7 @@ static void alcor_reset(struct alcor_sdmmc_host *host, u8 val)
>  static void alcor_data_set_dma(struct alcor_sdmmc_host *host)
>  {
>         struct alcor_pci_priv *priv = host->alcor_pci;
> -       u32 addr, len;
> +       u32 addr;
>
>         if (!host->sg_count)
>                 return;
> @@ -138,7 +138,6 @@ static void alcor_data_set_dma(struct alcor_sdmmc_host *host)
>
>
>         addr = (u32)sg_dma_address(host->sg);
> -       len = sg_dma_len(host->sg);
>
>         alcor_write32(priv, addr, AU6601_REG_SDMA_ADDR);
>         host->sg = sg_next(host->sg);
> @@ -645,7 +644,6 @@ static irqreturn_t alcor_irq(int irq, void *d)
>  static void alcor_set_clock(struct alcor_sdmmc_host *host, unsigned int clock)
>  {
>         struct alcor_pci_priv *priv = host->alcor_pci;
> -       unsigned int clock_out = 0;
>         int i, diff = 0x7fffffff, tmp_clock = 0;
>         u16 clk_src = 0;
>         u8 clk_div = 0;
> @@ -670,7 +668,6 @@ static void alcor_set_clock(struct alcor_sdmmc_host *host, unsigned int clock)
>                         diff = tmp_diff;
>                         clk_src = cfg->clk_src_reg;
>                         clk_div = tmp_div;
> -                       clock_out = tmp_clock;
>                 }
>         }
>
>
>
>
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-11  9:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-07  6:34 [PATCH -next] mmc: remove set but not used variables 'len, clock_out' YueHaibing
2018-12-07 18:04 ` Oleksij Rempel
2018-12-11  9:31 ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.