public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: dw_mmc: Remove set-but-unused variable.
@ 2011-02-28 21:55 Chris Ball
  2011-03-01 10:07 ` Will Newton
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Ball @ 2011-02-28 21:55 UTC (permalink / raw)
  To: linux-mmc; +Cc: Chris Ball, Will Newton

count is only ever used by assigning to old_len if count == 0, and
then old_len isn't ever used at all.  So, both are redundant.  Fixes:

drivers/mmc/host/dw_mmc.c: In function ‘dw_mci_read_data_pio’:
drivers/mmc/host/dw_mmc.c:1034:32: warning: variable ‘old_len’ set but
not used [-Wunused-but-set-variable]

Signed-off-by: Chris Ball <cjb@laptop.org>
Cc: Will Newton <will.newton@imgtec.com>
---
 drivers/mmc/host/dw_mmc.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 58476c1..299c1d6 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1031,13 +1031,10 @@ static void dw_mci_read_data_pio(struct dw_mci *host)
 	struct mmc_data	*data = host->data;
 	int shift = host->data_shift;
 	u32 status;
-	unsigned int nbytes = 0, len, old_len, count = 0;
+	unsigned int nbytes = 0, len;
 
 	do {
 		len = SDMMC_GET_FCNT(mci_readl(host, STATUS)) << shift;
-		if (count == 0)
-			old_len = len;
-
 		if (offset + len <= sg->length) {
 			host->pull_data(host, (void *)(buf + offset), len);
 
@@ -1082,7 +1079,6 @@ static void dw_mci_read_data_pio(struct dw_mci *host)
 			tasklet_schedule(&host->tasklet);
 			return;
 		}
-		count++;
 	} while (status & SDMMC_INT_RXDR); /*if the RXDR is ready read again*/
 	len = SDMMC_GET_FCNT(mci_readl(host, STATUS));
 	host->pio_offset = offset;
-- 
1.7.0.1


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

* Re: [PATCH] mmc: dw_mmc: Remove set-but-unused variable.
  2011-02-28 21:55 [PATCH] mmc: dw_mmc: Remove set-but-unused variable Chris Ball
@ 2011-03-01 10:07 ` Will Newton
  2011-03-02  2:55   ` Jaehoon Chung
  0 siblings, 1 reply; 3+ messages in thread
From: Will Newton @ 2011-03-01 10:07 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc

On Mon, Feb 28, 2011 at 9:55 PM, Chris Ball <cjb@laptop.org> wrote:
> count is only ever used by assigning to old_len if count == 0, and
> then old_len isn't ever used at all.  So, both are redundant.  Fixes:
>
> drivers/mmc/host/dw_mmc.c: In function ‘dw_mci_read_data_pio’:
> drivers/mmc/host/dw_mmc.c:1034:32: warning: variable ‘old_len’ set but
> not used [-Wunused-but-set-variable]
>
> Signed-off-by: Chris Ball <cjb@laptop.org>
> Cc: Will Newton <will.newton@imgtec.com>

Looks good, thanks for fixing this!

Acked-by: Will Newton <will.newton@imgtec.com>

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

* Re: [PATCH] mmc: dw_mmc: Remove set-but-unused variable.
  2011-03-01 10:07 ` Will Newton
@ 2011-03-02  2:55   ` Jaehoon Chung
  0 siblings, 0 replies; 3+ messages in thread
From: Jaehoon Chung @ 2011-03-02  2:55 UTC (permalink / raw)
  To: Will Newton; +Cc: Chris Ball, linux-mmc

Acked-by: Jaehoon Chung <jh80.chung@samsung.com>

Will Newton wrote:
> On Mon, Feb 28, 2011 at 9:55 PM, Chris Ball <cjb@laptop.org> wrote:
>> count is only ever used by assigning to old_len if count == 0, and
>> then old_len isn't ever used at all.  So, both are redundant.  Fixes:
>>
>> drivers/mmc/host/dw_mmc.c: In function ‘dw_mci_read_data_pio’:
>> drivers/mmc/host/dw_mmc.c:1034:32: warning: variable ‘old_len’ set but
>> not used [-Wunused-but-set-variable]
>>
>> Signed-off-by: Chris Ball <cjb@laptop.org>
>> Cc: Will Newton <will.newton@imgtec.com>
> 
> Looks good, thanks for fixing this!
> 
> Acked-by: Will Newton <will.newton@imgtec.com>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


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

end of thread, other threads:[~2011-03-02  3:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-28 21:55 [PATCH] mmc: dw_mmc: Remove set-but-unused variable Chris Ball
2011-03-01 10:07 ` Will Newton
2011-03-02  2:55   ` Jaehoon Chung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox