mmc: sdhci-pci: Remove set-but-unused variable.
Subsystems (3)
PATCH 1/3 mmc: sdhci-pci: Remove set-but-unused variable.
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]
--- drivers/mmc/host/sdhci-pci.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)
drivers/mmc/host/sdhci-pci.c +0 -4
@@ -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" );
Signature · 1 line
1.7.0.1
PATCH 2/3 mmc: cb710: Remove set-but-unused variable.
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]
--- drivers/mmc/host/cb710-mmc.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/mmc/host/cb710-mmc.c +0 -2
@@ -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 );
Signature · 1 line
1.7.0.1
Re: [PATCH 2/3] mmc: cb710: Remove set-but-unused variable.
Quoted 23 lines · 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 <[email protected]>Cc Michał Mirosław <[email protected]>--- drivers/mmc/host/cb710-mmc.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)drivers/mmc/host/cb710-mmc.c +0
-1@@ -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;
drivers/mmc/host/cb710-mmc.c static int cb710_wait_while_busy(struct cb710_slot *slot, uint8_t mask) · line 194
Quoted 7 lines
drivers/mmc/host/cb710-mmc.c +0
-1@@ -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:
Signature · 2 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
PATCH v2 2/3 mmc: cb710: Return err value in cb710_wait_while_busy()
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]
---
Hi Wolfram,
Quoted 2 lines
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(-)
drivers/mmc/host/cb710-mmc.c +1 -1
@@ -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,
Signature · 5 lines
1.7.0.1 -- Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child
Re: [PATCH v2 2/3] mmc: cb710: Return err value in cb710_wait_while_busy()
Quoted 9 lines · Chris Ball
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 <[email protected]>Cc Michał Mirosław <[email protected]>Cc Wolfram Sang <[email protected]>
Signature · 2 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Re: [PATCH v2 2/3] mmc: cb710: Return err value in cb710_wait_while_busy()
In reply to Chris BallQuoted 27 lines · Chris Ball
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 <[email protected]>Cc Michał Mirosław <[email protected]>Cc Wolfram Sang <[email protected]>---
Hi Wolfram,Quoted 2 lines
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(-)drivers/mmc/host/cb710-mmc.c +0
-0
drivers/mmc/host/cb710-mmc.c static int cb710_wait_while_busy(struct cb710_slot *slot, uint8_t mask) · line 211
Quoted 8 lines
drivers/mmc/host/cb710-mmc.c +1
-1@@ -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.
PATCH 3/3 mmc: via-sdmmc: Remove set-but-unused variable.
In reply to Chris Balldrivers/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]
--- drivers/mmc/host/via-sdmmc.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
drivers/mmc/host/via-sdmmc.c +0 -3
@@ -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);
Signature · 1 line
1.7.0.1