All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lothar Waßmann" <LW@KARO-electronics.de>
To: linux-kernel@vger.kernel.org
Cc: "Jeremy Kerr" <jeremy.kerr@canonical.com>,
	linux-arm-kernel@lists.infradead.org,
	"Lothar Waßmann" <LW@KARO-electronics.de>
Subject: [BUGFIX][PATCH] Fix double inversion bug in clk_disable()
Date: Tue,  2 Aug 2011 13:26:30 +0200	[thread overview]
Message-ID: <1312284390-20244-1-git-send-email-LW@KARO-electronics.de> (raw)

The condition check for calling the low level disable function is
wrong due to double inversion via '!' and '== 0'.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 drivers/clk/clk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 83c6b67..1525e2a 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -81,7 +81,7 @@ void clk_disable(struct clk *clk)
 
 	WARN_ON(clk->enable_count == 0);
 
-	if (!--clk->enable_count == 0 && clk->ops->disable)
+	if (--clk->enable_count == 0 && clk->ops->disable)
 		clk->ops->disable(clk);
 
 	spin_unlock_irqrestore(&clk->enable_lock, flags);
-- 
1.5.6.5


WARNING: multiple messages have this Message-ID (diff)
From: LW@KARO-electronics.de (Lothar Waßmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [BUGFIX][PATCH] Fix double inversion bug in clk_disable()
Date: Tue,  2 Aug 2011 13:26:30 +0200	[thread overview]
Message-ID: <1312284390-20244-1-git-send-email-LW@KARO-electronics.de> (raw)

The condition check for calling the low level disable function is
wrong due to double inversion via '!' and '== 0'.

Signed-off-by: Lothar Wa?mann <LW@KARO-electronics.de>
---
 drivers/clk/clk.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 83c6b67..1525e2a 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -81,7 +81,7 @@ void clk_disable(struct clk *clk)
 
 	WARN_ON(clk->enable_count == 0);
 
-	if (!--clk->enable_count == 0 && clk->ops->disable)
+	if (--clk->enable_count == 0 && clk->ops->disable)
 		clk->ops->disable(clk);
 
 	spin_unlock_irqrestore(&clk->enable_lock, flags);
-- 
1.5.6.5

             reply	other threads:[~2011-08-02 11:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-02 11:26 Lothar Waßmann [this message]
2011-08-02 11:26 ` [BUGFIX][PATCH] Fix double inversion bug in clk_disable() Lothar Waßmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1312284390-20244-1-git-send-email-LW@KARO-electronics.de \
    --to=lw@karo-electronics.de \
    --cc=jeremy.kerr@canonical.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.