drivers/mmc/fsl_esdhc.c: fix compiler warnings
PATCH 1/1 drivers/mmc/fsl_esdhc.c: fix compiler warnings
Commit 77c1458d caused the following compiler warnings:
fsl_esdhc.c: In function 'esdhc_pio_read_write':
fsl_esdhc.c:142: warning: assignment discards qualifiers from pointer target type fsl_esdhc.c: In function 'esdhc_setup_data':
fsl_esdhc.c:169: warning: unused variable 'wml_value'fsl_esdhc.c: In function 'esdhc_pio_read_write':
fsl_esdhc.c:164: warning: control reaches end of non-void function
Fix these.
--- drivers/mmc/fsl_esdhc.c | 34 +++++++++++++++++----------------- 1 files changed, 17 insertions(+), 17 deletions(-)
drivers/mmc/fsl_esdhc.c +17 -17
@@ -103,7 +103,7 @@ uint esdhc_xfertyp(struct mmc_cmd *cmd, struct mmc_data *data)/* * PIO Read/Write Mode reduce the performace as DMA is not used in this mode. */ -static int +static void esdhc_pio_read_write (struct mmc *mmc,struct mmc_data *data) {struct fsl_esdhc *regs = mmc->priv;
@@ -125,7 +125,7 @@ esdhc_pio_read_write(struct mmc *mmc, struct mmc_data *data) && --timeout);if (timeout <=0 ) {printf ("\nData Read Failed in PIO Mode." ); -return timeout; +return ; }while (size && (!(irqstat &IRQSTAT_TC ))) {udelay (100 );/* Wait before last byte transfer complete */
@@ -139,7 +139,7 @@ esdhc_pio_read_write(struct mmc *mmc, struct mmc_data *data) } }else { blocks = data->blocks; - buffer = data->src; + buffer = (char *)data->src;while (blocks) { timeout =PIO_TIMEOUT ; size = data->blocksize;
@@ -148,7 +148,7 @@ esdhc_pio_read_write(struct mmc *mmc, struct mmc_data *data) && --timeout);if (timeout <=0 ) {printf ("\nData Write Failed in PIO Mode." ); -return timeout; +return ; }while (size && (!(irqstat &IRQSTAT_TC ))) {udelay (100 );/* Wait before last byte transfer complete */
@@ -166,22 +166,12 @@ esdhc_pio_read_write(struct mmc *mmc, struct mmc_data *data)static int esdhc_setup_data (struct mmc *mmc,struct mmc_data *data) { -uint wml_value;int timeout;struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;struct fsl_esdhc *regs = (struct fsl_esdhc *)cfg->esdhc_base; +#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO +uint wml_value; -#ifdef CONFIG_SYS_FSL_ESDHC_USE_PIO -if (!(data->flags &MMC_DATA_READ )) { -if ((esdhc_read32 (®s->prsstat) &PRSSTAT_WPSPL ) ==0 ) { -printf ("\nThe SD card is locked. " -"Can not write to a locked card.\n\n" ); -return TIMEOUT ; - } -esdhc_write32 (®s->dsaddr, (u32 )data->src); - }else -esdhc_write32 (®s->dsaddr, (u32 )data->dest); -#else wml_value = data->blocksize/4 ;if (data->flags &MMC_DATA_READ ) {
@@ -202,7 +192,17 @@ static int esdhc_setup_data(struct mmc *mmc, struct mmc_data *data) wml_value << 16); esdhc_write32(®s->dsaddr, (u32)data->src); } -#endif +#else /* CONFIG_SYS_FSL_ESDHC_USE_PIO */ +if (!(data->flags &MMC_DATA_READ )) { +if ((esdhc_read32 (®s->prsstat) &PRSSTAT_WPSPL ) ==0 ) { +printf ("\nThe SD card is locked. " +"Can not write to a locked card.\n\n" ); +return TIMEOUT ; + } +esdhc_write32 (®s->dsaddr, (u32 )data->src); + }else +esdhc_write32 (®s->dsaddr, (u32 )data->dest); +#endif /* CONFIG_SYS_FSL_ESDHC_USE_PIO */ esdhc_write32 (®s->blkattr, data->blocks <<16 | data->blocksize);
Signature · 1 line
1.6.6.1
Wolfgang Denk
AppliedPATCH 1/1 drivers/mmc/fsl_esdhc.c: fix compiler warnings
Quoted 9 lines · In message <[email protected]> Wolfgang Denk wrote:
Commit
77c1458dcaused the following compiler warnings:
fsl_esdhc.c: In function 'esdhc_pio_read_write':
fsl_esdhc.c:142: warning: assignment discards qualifiers from pointer target typefsl_esdhc.c: In function 'esdhc_setup_data':
fsl_esdhc.c:169: warning: unused variable 'wml_value'fsl_esdhc.c: In function 'esdhc_pio_read_write':
fsl_esdhc.c:164: warning: control reaches end of non-void function
Quoted 8 lines
Fix these.
Signed-off-by Wolfgang Denk <[email protected]>Cc Dipen Dudhat <[email protected]>Cc Andy Fleming <[email protected]>--- drivers/mmc/fsl_esdhc.c | 34 +++++++++++++++++----------------- 1 files changed, 17 insertions(+), 17 deletions(-)
Applied.
Andy, I hope this is OK with you.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de How much net work could a network work, if a network could net work?