public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: omap_hsmmc: correct precedence of operators
       [not found] <1356030701-16284-1-git-send-email-sasha.levin@oracle.com>
@ 2012-12-20 19:11 ` Sasha Levin
  2012-12-20 20:30   ` Felipe Balbi
  2012-12-20 23:04   ` Paul Walmsley
  0 siblings, 2 replies; 3+ messages in thread
From: Sasha Levin @ 2012-12-20 19:11 UTC (permalink / raw)
  To: Venkatraman S, Chris Ball, linux-mmc, linux-omap, linux-kernel
  Cc: Sasha Levin

With the current code, the condition in the if() doesn't make much sense due to
precedence of operators.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/mmc/host/omap_hsmmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index bc58078..3ee2664 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -611,7 +611,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.8.0

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

* Re: [PATCH] mmc: omap_hsmmc: correct precedence of operators
  2012-12-20 19:11 ` [PATCH] mmc: omap_hsmmc: correct precedence of operators Sasha Levin
@ 2012-12-20 20:30   ` Felipe Balbi
  2012-12-20 23:04   ` Paul Walmsley
  1 sibling, 0 replies; 3+ messages in thread
From: Felipe Balbi @ 2012-12-20 20:30 UTC (permalink / raw)
  To: Sasha Levin
  Cc: Venkatraman S, Chris Ball, linux-mmc, linux-omap, linux-kernel

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

On Thu, Dec 20, 2012 at 02:11:26PM -0500, Sasha Levin wrote:
> With the current code, the condition in the if() doesn't make much sense due to
> precedence of operators.
> 
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>

nice catch!!!

Acked-by: Felipe Balbi <balbi@ti.com>

> ---
>  drivers/mmc/host/omap_hsmmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index bc58078..3ee2664 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -611,7 +611,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.8.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
balbi

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

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

* Re: [PATCH] mmc: omap_hsmmc: correct precedence of operators
  2012-12-20 19:11 ` [PATCH] mmc: omap_hsmmc: correct precedence of operators Sasha Levin
  2012-12-20 20:30   ` Felipe Balbi
@ 2012-12-20 23:04   ` Paul Walmsley
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Walmsley @ 2012-12-20 23:04 UTC (permalink / raw)
  To: Sasha Levin
  Cc: Venkatraman S, t-kristo, Chris Ball, linux-mmc, linux-omap,
	linux-kernel

(cc Tero)

Hi,

On Thu, 20 Dec 2012, Sasha Levin wrote:

> With the current code, the condition in the if() doesn't make much sense due to
> precedence of operators.
> 
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
> ---
>  drivers/mmc/host/omap_hsmmc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index bc58078..3ee2664 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -611,7 +611,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) {

Makes sense to me, but I wonder if this code is even necessary after:

commit 613ad0e98c3596cd2524172fae2a795c3fc57e4a
Author: Tero Kristo <t-kristo@ti.com>
Date:   Mon Oct 29 22:02:13 2012 -0600

    ARM: OMAP: hwmod: wait for sysreset complete after enabling hwmod
    

?  You might just be able to drop those lines completely now.



- Paul

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

end of thread, other threads:[~2012-12-20 23:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1356030701-16284-1-git-send-email-sasha.levin@oracle.com>
2012-12-20 19:11 ` [PATCH] mmc: omap_hsmmc: correct precedence of operators Sasha Levin
2012-12-20 20:30   ` Felipe Balbi
2012-12-20 23:04   ` Paul Walmsley

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