public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] mmc: sdhci-pci: Remove set-but-unused variable.
@ 2011-02-23 22:29 Chris Ball
  2011-02-23 22:29 ` [PATCH 2/3] mmc: cb710: " Chris Ball
  2011-02-23 22:29 ` [PATCH 3/3] mmc: via-sdmmc: Remove set-but-unused variable Chris Ball
  0 siblings, 2 replies; 7+ messages in thread
From: Chris Ball @ 2011-02-23 22:29 UTC (permalink / raw)
  To: linux-mmc; +Cc: Chris Ball

drivers/mmc/host/sdhci-pci.c: In function ‘sdhci_pci_probe_slot’:
drivers/mmc/host/sdhci-pci.c:913:18: warning: variable ‘addr’ set but
not used [-Wunused-but-set-variable]

Signed-off-by: Chris Ball <cjb@laptop.org>
---
 drivers/mmc/host/sdhci-pci.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
index 4cb2d0e..ed2cffa 100644
--- a/drivers/mmc/host/sdhci-pci.c
+++ b/drivers/mmc/host/sdhci-pci.c
@@ -909,9 +909,6 @@ static struct sdhci_pci_slot * __devinit sdhci_pci_probe_slot(
 {
 	struct sdhci_pci_slot *slot;
 	struct sdhci_host *host;
-
-	resource_size_t addr;
-
 	int ret;
 
 	if (!(pci_resource_flags(pdev, bar) & IORESOURCE_MEM)) {
@@ -958,7 +955,6 @@ static struct sdhci_pci_slot * __devinit sdhci_pci_probe_slot(
 		goto free;
 	}
 
-	addr = pci_resource_start(pdev, bar);
 	host->ioaddr = pci_ioremap_bar(pdev, bar);
 	if (!host->ioaddr) {
 		dev_err(&pdev->dev, "failed to remap registers\n");
-- 
1.7.0.1


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

* [PATCH 2/3] mmc: cb710: Remove set-but-unused variable.
  2011-02-23 22:29 [PATCH 1/3] mmc: sdhci-pci: Remove set-but-unused variable Chris Ball
@ 2011-02-23 22:29 ` Chris Ball
  2011-02-23 23:03   ` Wolfram Sang
  2011-02-23 22:29 ` [PATCH 3/3] mmc: via-sdmmc: Remove set-but-unused variable Chris Ball
  1 sibling, 1 reply; 7+ messages in thread
From: Chris Ball @ 2011-02-23 22:29 UTC (permalink / raw)
  To: linux-mmc; +Cc: Chris Ball, Michał Mirosław

drivers/mmc/host/sdhci-pci.c: In function ‘sdhci_pci_probe_slot’:
drivers/mmc/host/sdhci-pci.c:913:18: warning: variable ‘addr’ set but
not used [-Wunused-but-set-variable]

Signed-off-by: Chris Ball <cjb@laptop.org>
Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 drivers/mmc/host/cb710-mmc.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c
index 66b4ce5..280c03a 100644
--- a/drivers/mmc/host/cb710-mmc.c
+++ b/drivers/mmc/host/cb710-mmc.c
@@ -179,7 +179,6 @@ static int cb710_wait_for_event(struct cb710_slot *slot, u8 what)
 static int cb710_wait_while_busy(struct cb710_slot *slot, uint8_t mask)
 {
 	unsigned limit = 500000;	/* FIXME: real timeout */
-	int err = 0;
 
 #ifdef CONFIG_CB710_DEBUG
 	u32 e, x;
@@ -190,7 +189,6 @@ static int cb710_wait_while_busy(struct cb710_slot *slot, uint8_t mask)
 		if (!--limit) {
 			cb710_dump_regs(cb710_slot_to_chip(slot),
 				CB710_DUMP_REGS_MMC);
-			err = -ETIMEDOUT;
 			break;
 		}
 		udelay(1);
-- 
1.7.0.1


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

* [PATCH 3/3] mmc: via-sdmmc: Remove set-but-unused variable.
  2011-02-23 22:29 [PATCH 1/3] mmc: sdhci-pci: Remove set-but-unused variable Chris Ball
  2011-02-23 22:29 ` [PATCH 2/3] mmc: cb710: " Chris Ball
@ 2011-02-23 22:29 ` Chris Ball
  1 sibling, 0 replies; 7+ messages in thread
From: Chris Ball @ 2011-02-23 22:29 UTC (permalink / raw)
  To: linux-mmc; +Cc: Chris Ball, Harald Welte

drivers/mmc/host/via-sdmmc.c: In function ‘via_reset_pcictrl’:
drivers/mmc/host/via-sdmmc.c:805:8: warning: variable ‘addrbase’ set but
not used [-Wunused-but-set-variable]

Signed-off-by: Chris Ball <cjb@laptop.org>
Cc: Harald Welte <HaraldWelte@viatech.com>
---
 drivers/mmc/host/via-sdmmc.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/via-sdmmc.c b/drivers/mmc/host/via-sdmmc.c
index 9ed84dd..8c5b488 100644
--- a/drivers/mmc/host/via-sdmmc.c
+++ b/drivers/mmc/host/via-sdmmc.c
@@ -802,12 +802,9 @@ static const struct mmc_host_ops via_sdc_ops = {
 
 static void via_reset_pcictrl(struct via_crdr_mmc_host *host)
 {
-	void __iomem *addrbase;
 	unsigned long flags;
 	u8 gatt;
 
-	addrbase = host->pcictrl_mmiobase;
-
 	spin_lock_irqsave(&host->lock, flags);
 
 	via_save_pcictrlreg(host);
-- 
1.7.0.1


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

* Re: [PATCH 2/3] mmc: cb710: Remove set-but-unused variable.
  2011-02-23 22:29 ` [PATCH 2/3] mmc: cb710: " Chris Ball
@ 2011-02-23 23:03   ` Wolfram Sang
  2011-02-23 23:17     ` [PATCH v2 2/3] mmc: cb710: Return err value in cb710_wait_while_busy() Chris Ball
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2011-02-23 23:03 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, Michał Mirosław

[-- Attachment #1: Type: text/plain, Size: 1526 bytes --]

On Wed, Feb 23, 2011 at 05:29:12PM -0500, Chris Ball wrote:
> drivers/mmc/host/sdhci-pci.c: In function ‘sdhci_pci_probe_slot’:
> drivers/mmc/host/sdhci-pci.c:913:18: warning: variable ‘addr’ set but
> not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Chris Ball <cjb@laptop.org>
> Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
>  drivers/mmc/host/cb710-mmc.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c
> index 66b4ce5..280c03a 100644
> --- a/drivers/mmc/host/cb710-mmc.c
> +++ b/drivers/mmc/host/cb710-mmc.c
> @@ -179,7 +179,6 @@ static int cb710_wait_for_event(struct cb710_slot *slot, u8 what)
>  static int cb710_wait_while_busy(struct cb710_slot *slot, uint8_t mask)
>  {
>  	unsigned limit = 500000;	/* FIXME: real timeout */
> -	int err = 0;
>  
>  #ifdef CONFIG_CB710_DEBUG
>  	u32 e, x;
> @@ -190,7 +189,6 @@ static int cb710_wait_while_busy(struct cb710_slot *slot, uint8_t mask)
>  		if (!--limit) {
>  			cb710_dump_regs(cb710_slot_to_chip(slot),
>  				CB710_DUMP_REGS_MMC);
> -			err = -ETIMEDOUT;
>  			break;
>  		}
>  		udelay(1);

What about changing return 0 into return err? It gets checked in
cb710_mmc_powerup().

The _other two_ patches:

Acked-by: Wolfram Sang <w.sang@pengutronix.de>

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* [PATCH v2 2/3] mmc: cb710: Return err value in cb710_wait_while_busy()
  2011-02-23 23:03   ` Wolfram Sang
@ 2011-02-23 23:17     ` Chris Ball
  2011-02-24  8:40       ` Wolfram Sang
  2011-02-25 18:22       ` Michał Mirosław
  0 siblings, 2 replies; 7+ messages in thread
From: Chris Ball @ 2011-02-23 23:17 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-mmc, Michał Mirosław

Fixes:

drivers/mmc/host/cb710-mmc.c: In function ‘cb710_wait_while_busy’:
drivers/mmc/host/cb710-mmc.c:182:6: warning: variable ‘err’ set but not
used [-Wunused-but-set-variable]

Signed-off-by: Chris Ball <cjb@laptop.org>
Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Cc: Wolfram Sang <w.sang@pengutronix.de>
---
Hi Wolfram,

> What about changing return 0 into return err? It gets checked in
> cb710_mmc_powerup().

Thanks, good idea.

- Chris.

 drivers/mmc/host/cb710-mmc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c
index 66b4ce5..ce2a47b 100644
--- a/drivers/mmc/host/cb710-mmc.c
+++ b/drivers/mmc/host/cb710-mmc.c
@@ -205,7 +205,7 @@ static int cb710_wait_while_busy(struct cb710_slot *slot, uint8_t mask)
 			"WAIT12: waited %d loops, mask %02X, entry val %08X, exit val %08X\n",
 			limit, mask, e, x);
 #endif
-	return 0;
+	return err;
 }
 
 static void cb710_mmc_set_transfer_size(struct cb710_slot *slot,
-- 
1.7.0.1

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH v2 2/3] mmc: cb710: Return err value in cb710_wait_while_busy()
  2011-02-23 23:17     ` [PATCH v2 2/3] mmc: cb710: Return err value in cb710_wait_while_busy() Chris Ball
@ 2011-02-24  8:40       ` Wolfram Sang
  2011-02-25 18:22       ` Michał Mirosław
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2011-02-24  8:40 UTC (permalink / raw)
  To: Chris Ball; +Cc: linux-mmc, Michał Mirosław

[-- Attachment #1: Type: text/plain, Size: 618 bytes --]

On Wed, Feb 23, 2011 at 11:17:43PM +0000, Chris Ball wrote:
> Fixes:
> 
> drivers/mmc/host/cb710-mmc.c: In function ‘cb710_wait_while_busy’:
> drivers/mmc/host/cb710-mmc.c:182:6: warning: variable ‘err’ set but not
> used [-Wunused-but-set-variable]
> 
> Signed-off-by: Chris Ball <cjb@laptop.org>
> Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> Cc: Wolfram Sang <w.sang@pengutronix.de>

Acked-by: Wolfram Sang <w.sang@pengutronix.de>

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [PATCH v2 2/3] mmc: cb710: Return err value in cb710_wait_while_busy()
  2011-02-23 23:17     ` [PATCH v2 2/3] mmc: cb710: Return err value in cb710_wait_while_busy() Chris Ball
  2011-02-24  8:40       ` Wolfram Sang
@ 2011-02-25 18:22       ` Michał Mirosław
  1 sibling, 0 replies; 7+ messages in thread
From: Michał Mirosław @ 2011-02-25 18:22 UTC (permalink / raw)
  To: Chris Ball; +Cc: Wolfram Sang, linux-mmc

On Wed, Feb 23, 2011 at 11:17:43PM +0000, Chris Ball wrote:
> Fixes:
> 
> drivers/mmc/host/cb710-mmc.c: In function ‘cb710_wait_while_busy’:
> drivers/mmc/host/cb710-mmc.c:182:6: warning: variable ‘err’ set but not
> used [-Wunused-but-set-variable]
> 
> Signed-off-by: Chris Ball <cjb@laptop.org>
> Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> Cc: Wolfram Sang <w.sang@pengutronix.de>
> ---
> Hi Wolfram,
> 
> > What about changing return 0 into return err? It gets checked in
> > cb710_mmc_powerup().
> 
> Thanks, good idea.
> 
> - Chris.
> 
>  drivers/mmc/host/cb710-mmc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c
> index 66b4ce5..ce2a47b 100644
> --- a/drivers/mmc/host/cb710-mmc.c
> +++ b/drivers/mmc/host/cb710-mmc.c
> @@ -205,7 +205,7 @@ static int cb710_wait_while_busy(struct cb710_slot *slot, uint8_t mask)
>  			"WAIT12: waited %d loops, mask %02X, entry val %08X, exit val %08X\n",
>  			limit, mask, e, x);
>  #endif
> -	return 0;
> +	return err;
>  }
>  
>  static void cb710_mmc_set_transfer_size(struct cb710_slot *slot,

This patch is good. This part is not completely demystified though, and some
parts of the code don't care about this function's return value.

Acked-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>


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

end of thread, other threads:[~2011-02-25 18:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-23 22:29 [PATCH 1/3] mmc: sdhci-pci: Remove set-but-unused variable Chris Ball
2011-02-23 22:29 ` [PATCH 2/3] mmc: cb710: " Chris Ball
2011-02-23 23:03   ` Wolfram Sang
2011-02-23 23:17     ` [PATCH v2 2/3] mmc: cb710: Return err value in cb710_wait_while_busy() Chris Ball
2011-02-24  8:40       ` Wolfram Sang
2011-02-25 18:22       ` Michał Mirosław
2011-02-23 22:29 ` [PATCH 3/3] mmc: via-sdmmc: Remove set-but-unused variable Chris Ball

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