From patchwork Tue Aug 2 11:26:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Lothar_Wa=C3=9Fmann?= X-Patchwork-Id: 1029172 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p72BQt8g018762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 2 Aug 2011 11:27:16 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QoD7U-00038Z-0T; Tue, 02 Aug 2011 11:26:44 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QoD7T-00032x-IG; Tue, 02 Aug 2011 11:26:43 +0000 Received: from mail.karo-electronics.de ([81.173.242.67]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QoD7R-00032g-1K for linux-arm-kernel@lists.infradead.org; Tue, 02 Aug 2011 11:26:42 +0000 From: =?utf-8?q?Lothar=20Wa=C3=9Fmann?= To: linux-kernel@vger.kernel.org Subject: [BUGFIX][PATCH] Fix double inversion bug in clk_disable() Date: Tue, 2 Aug 2011 13:26:30 +0200 Message-Id: <1312284390-20244-1-git-send-email-LW@KARO-electronics.de> X-Mailer: git-send-email 1.5.6.5 MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110802_072641_648119_3BD99E8A X-CRM114-Status: UNSURE ( 9.38 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.8 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Jeremy Kerr , linux-arm-kernel@lists.infradead.org, =?utf-8?q?Lothar=20Wa=C3=9Fmann?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 02 Aug 2011 11:27:32 +0000 (UTC) X-MIME-Autoconverted: from base64 to 8bit by demeter1.kernel.org id p72BQt8g018762 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 --- 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);