Skip to contentSkip to conversation

mmc: omap_hsmmc: precedence bug in omap_hsmmc_context_restore()

PATCH In review Dan Carpenter 2 participants 4 messages Aug 22, 2013 – Jan 30, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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
index 1865321..7346b15 100644
@@ -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) {
#1 lore raw
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

---
Untested.

drivers/mmc/host/omap_hsmmc.c +0 -0
index 1865321..7346b15 100644

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.

#2 lore raw
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

---
Untested.

drivers/mmc/host/omap_hsmmc.c +0 -0
index 1865321..7346b15 100644
@@ -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

#3 lore raw
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

---
Untested.

drivers/mmc/host/omap_hsmmc.c +0 -0
index 1865321..7346b15 100644
@@ -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