mmc: omap_hsmmc: precedence bug in omap_hsmmc_context_restore()
Subsystems (3)
PATCH 1/1 mmc: omap_hsmmc: precedence bug in omap_hsmmc_context_restore()
'!' has higher precedence than '&' so this doesn't work as intended although since RESETDONE is 1 it would work if none of the other bits are set.
---
Untested.
drivers/mmc/host/omap_hsmmc.c +1 -1
@@ -612,7 +612,7 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)if (host->context_loss = context_loss)return 1 ; -if (!OMAP_HSMMC_READ (host->base,SYSSTATUS ) &RESETDONE ) +if (!(OMAP_HSMMC_READ (host->base,SYSSTATUS ) &RESETDONE ))return 1 ;if (host->pdata->controller_flags &OMAP_HSMMC_SUPPORTS_DUAL_VOLT ) {
Quoted 4 lines · Dan Carpenter
'!' has higher precedence than '&' so this doesn't work as intended although since RESETDONE is 1 it would work if none of the other bits are set.
Hi Dan,
Thanks for the patch, Indeed other bits are reserved. however ...
Quoted 9 lines
Signed-off-by Dan Carpenter <[email protected]>---
Untested.drivers/mmc/host/omap_hsmmc.c +0
-0
drivers/mmc/host/omap_hsmmc.c static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host) · line 616
Quoted 6 lines
drivers/mmc/host/omap_hsmmc.c +1
-1@@ -612,7 +612,7 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)if (host->context_loss == context_loss)return 1 ; -if (!OMAP_HSMMC_READ (host->base,SYSSTATUS ) &RESETDONE ) +if (!(OMAP_HSMMC_READ (host->base,SYSSTATUS ) &RESETDONE ))return 1 ;
This check is unnecessary, will send a patch to remove this.
Quoted 22 lines · Balaji T K
Quoted 4 lines · Dan Carpenter
'!' has higher precedence than '&' so this doesn't work as intended although since RESETDONE is 1 it would work if none of the other bits are set.
Hi Dan,
Thanks for the patch, Indeed other bits are reserved. however ...
Quoted 12 lines
Signed-off-by Dan Carpenter <[email protected]>---
Untested.drivers/mmc/host/omap_hsmmc.c +0
-0@@ -612,7 +612,7 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)if (host->context_loss = context_loss)return 1 ;
Quoted 5 lines
drivers/mmc/host/omap_hsmmc.c static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host) · line 616
Quoted 3 lines
drivers/mmc/host/omap_hsmmc.c +1
-1-if (!OMAP_HSMMC_READ (host->base,SYSSTATUS ) &RESETDONE ) +if (!(OMAP_HSMMC_READ (host->base,SYSSTATUS ) &RESETDONE ))return 1 ;This check is unnecessary, will send a patch to remove this.
What happened with this?
regards,
dan carpenter
Quoted 23 lines · Dan Carpenter
Quoted 22 lines · Balaji T K
Quoted 4 lines · Dan Carpenter
'!' has higher precedence than '&' so this doesn't work as intended although since RESETDONE is 1 it would work if none of the other bits are set.
Hi Dan,
Thanks for the patch, Indeed other bits are reserved. however ...
Quoted 12 lines
Signed-off-by Dan Carpenter <[email protected]>---
Untested.drivers/mmc/host/omap_hsmmc.c +0
-0@@ -612,7 +612,7 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)if (host->context_loss == context_loss)return 1 ;
Quoted 7 lines
Quoted 5 lines
drivers/mmc/host/omap_hsmmc.c static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host) · line 616
Quoted 3 lines
drivers/mmc/host/omap_hsmmc.c +1
-1-if (!OMAP_HSMMC_READ (host->base,SYSSTATUS ) &RESETDONE ) +if (!(OMAP_HSMMC_READ (host->base,SYSSTATUS ) &RESETDONE ))return 1 ;This check is unnecessary, will send a patch to remove this.
What happened with this?
My bad, I missed it, will fix it.
Thanks and Regards,
Balaji T K