From patchwork Sun Sep 18 17:59:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 76487 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp610340qgf; Sun, 18 Sep 2016 11:01:28 -0700 (PDT) X-Received: by 10.98.110.4 with SMTP id j4mr40203678pfc.56.1474221688829; Sun, 18 Sep 2016 11:01:28 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id u4si23977118paj.264.2016.09.18.11.01.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Sep 2016 11:01:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1blgOB-0005Nj-JA; Sun, 18 Sep 2016 18:00:27 +0000 Received: from conuserg-10.nifty.com ([210.131.2.77]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1blgO6-0004OD-Rs for linux-arm-kernel@lists.infradead.org; Sun, 18 Sep 2016 18:00:23 +0000 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-10.nifty.com with ESMTP id u8IHxNMA012728; Mon, 19 Sep 2016 02:59:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com u8IHxNMA012728 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1474221566; bh=HDocpKUKvpx/gQj4SKvACrs1B66M2L+xvrznRjBwM4w=; h=From:To:Cc:Subject:Date:From; b=xWckcwGSTpXn5ZKijpMsgMK5An8KJlvUHBwqQa/u+h6gZNl/cyLwtYVfub6hEWRIG YVST0FuJY3uveCJfK2bqXwD3Bto/uFO5bjNYNb0gDMeGf0MDR7OMvWBszf5pUy6g7S VRywwiAsZDBoYTi82/2KrHUzUWJgc3FHU/jWDuhTwAVKolWuRllGoXBGET5GqTTZ0h 6MXRUEv+6TTLvv8pgI9MhBipqczdxgoVkchPy20NRg60M+Z+5H4YjLrVJvjYwbPa0B yGD4NJg4GvgYGncn+nTY5yyr4HZE+Ki0qMQbaRcOwukmeRYeReYPSMmRddvbywjtAQ jcJvegip+C8WQ== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v4] ARM: w90x900: let clk_disable() return immediately if clk is NULL Date: Mon, 19 Sep 2016 02:59:19 +0900 Message-Id: <1474221559-21269-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160918_110023_217224_C917B2F2 X-CRM114-Status: UNSURE ( 8.16 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wan ZongShun , Michael Turquette , Stephen Boyd , Russell King , Ralf Baechle , linux-kernel@vger.kernel.org, Masahiro Yamada MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org In many of clk_disable() implementations, it is a no-op for a NULL pointer input, but this is one of the exceptions. Making it treewide consistent will allow clock consumers to call clk_disable() without NULL pointer check. Signed-off-by: Masahiro Yamada Acked-by: Wan Zongshun --- Changes in v4: - Split into per-arch patches Changes in v3: - Return only when clk is NULL. Do not take care of error pointer. Changes in v2: - Rebase on Linux 4.6-rc1 arch/arm/mach-w90x900/clock.c | 3 +++ 1 file changed, 3 insertions(+) -- 1.9.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/mach-w90x900/clock.c b/arch/arm/mach-w90x900/clock.c index 2c371ff..ac6fd1a 100644 --- a/arch/arm/mach-w90x900/clock.c +++ b/arch/arm/mach-w90x900/clock.c @@ -46,6 +46,9 @@ void clk_disable(struct clk *clk) { unsigned long flags; + if (!clk) + return; + WARN_ON(clk->enabled == 0); spin_lock_irqsave(&clocks_lock, flags);