From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754923AbdC1JVd (ORCPT ); Tue, 28 Mar 2017 05:21:33 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:30575 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752500AbdC1JVU (ORCPT ); Tue, 28 Mar 2017 05:21:20 -0400 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com v2S9Hu2q004893 X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Andrew Morton Cc: Stephen Boyd , Ralf Baechle , Michael Turquette , Masahiro Yamada , Haojian Zhuang , Eric Miao , Russell King , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 1/3] ARM: mmp: let clk_disable() return immediately if clk is NULL Date: Tue, 28 Mar 2017 18:17:02 +0900 Message-Id: <1490692624-11931-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490692624-11931-1-git-send-email-yamada.masahiro@socionext.com> References: <1490692624-11931-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- Changes in v5: - None 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-mmp/clock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mach-mmp/clock.c b/arch/arm/mach-mmp/clock.c index ac6633d..28fe64c 100644 --- a/arch/arm/mach-mmp/clock.c +++ b/arch/arm/mach-mmp/clock.c @@ -67,6 +67,9 @@ void clk_disable(struct clk *clk) { unsigned long flags; + if (!clk) + return; + WARN_ON(clk->enabled == 0); spin_lock_irqsave(&clocks_lock, flags); -- 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: yamada.masahiro@socionext.com (Masahiro Yamada) Date: Tue, 28 Mar 2017 18:17:02 +0900 Subject: [PATCH v5 1/3] ARM: mmp: let clk_disable() return immediately if clk is NULL In-Reply-To: <1490692624-11931-1-git-send-email-yamada.masahiro@socionext.com> References: <1490692624-11931-1-git-send-email-yamada.masahiro@socionext.com> Message-ID: <1490692624-11931-2-git-send-email-yamada.masahiro@socionext.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.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 --- Changes in v5: - None 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-mmp/clock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mach-mmp/clock.c b/arch/arm/mach-mmp/clock.c index ac6633d..28fe64c 100644 --- a/arch/arm/mach-mmp/clock.c +++ b/arch/arm/mach-mmp/clock.c @@ -67,6 +67,9 @@ void clk_disable(struct clk *clk) { unsigned long flags; + if (!clk) + return; + WARN_ON(clk->enabled == 0); spin_lock_irqsave(&clocks_lock, flags); -- 2.7.4