From patchwork Tue Mar 28 09:17:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 96127 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp1615965qgd; Tue, 28 Mar 2017 02:22:20 -0700 (PDT) X-Received: by 10.98.67.157 with SMTP id l29mr30543348pfi.251.1490692939972; Tue, 28 Mar 2017 02:22:19 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o21si2552931pfa.392.2017.03.28.02.22.19; Tue, 28 Mar 2017 02:22:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754924AbdC1JVd (ORCPT + 18 others); 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 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id v2S9Hu2q004893; Tue, 28 Mar 2017 18:17:58 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com v2S9Hu2q004893 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1490692678; bh=v/L3X1D+OvYPSIOe29bywF9iRCWQVs1r+KS4BFuGCgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DbyTG/9Ns8KKyHbPHgSTAsxxDFGpBoC8rYEWoByxCt/eaAwYrToDFObO7X2M2zfPM sSjKNqC3QN7WJibgM9pfWR88Twu48/dPtJ6Ecv36t9metxboXiPWjxtKmPbI2zkW2r NSbP7OoQzy5brGiNBLousimLyT9TRnjyEo6k8vXbTCv/Abawde2AqLeFFTcQTURVOL e3M89vbVh/EEQ+pI0NNqo6Bfpt9NZh7F4cP9Nftn1BOYQcRVwucm/q0GGb71Gt0jJQ 9X0xlUc+EADDBXwmcB7A5mN1i2F1jxnZqkBFsxtv4hcVH0fzqiNHZ0kWIMr/nCUQrN znWVCX7gMF7Fg== 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 Precedence: bulk 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(+) -- 2.7.4 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);