From: Masahiro Yamada <yamada.masahiro@socionext.com> To: Andrew Morton <akpm@linux-foundation.org> Cc: Stephen Boyd <sboyd@codeaurora.org>, Ralf Baechle <ralf@linux-mips.org>, Michael Turquette <mturquette@baylibre.com>, Masahiro Yamada <yamada.masahiro@socionext.com>, Haojian Zhuang <haojian.zhuang@gmail.com>, Eric Miao <eric.y.miao@gmail.com>, Russell King <linux@armlinux.org.uk>, 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 [thread overview] Message-ID: <1490692624-11931-2-git-send-email-yamada.masahiro@socionext.com> (raw) In-Reply-To: <1490692624-11931-1-git-send-email-yamada.masahiro@socionext.com> 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 <yamada.masahiro@socionext.com> --- 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
WARNING: multiple messages have this Message-ID (diff)
From: yamada.masahiro@socionext.com (Masahiro Yamada) To: linux-arm-kernel@lists.infradead.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 [thread overview] Message-ID: <1490692624-11931-2-git-send-email-yamada.masahiro@socionext.com> (raw) In-Reply-To: <1490692624-11931-1-git-send-email-yamada.masahiro@socionext.com> 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 <yamada.masahiro@socionext.com> --- 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
next prev parent reply other threads:[~2017-03-28 9:21 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-03-28 9:17 [PATCH v5 0/3] clk: let clk_disable() return immediately if clk is NULL for last 3 clks Masahiro Yamada 2017-03-28 9:17 ` Masahiro Yamada 2017-03-28 9:17 ` Masahiro Yamada [this message] 2017-03-28 9:17 ` [PATCH v5 1/3] ARM: mmp: let clk_disable() return immediately if clk is NULL Masahiro Yamada 2017-03-30 15:39 ` Arnd Bergmann 2017-03-30 15:39 ` Arnd Bergmann 2017-03-28 9:17 ` [PATCH v5 2/3] ARM: w90x900: " Masahiro Yamada 2017-03-28 9:17 ` Masahiro Yamada 2017-03-30 15:38 ` Arnd Bergmann 2017-03-30 15:38 ` Arnd Bergmann 2017-03-28 9:17 ` [PATCH v5 3/3] blackfin: bf609: " Masahiro Yamada 2017-04-13 3:33 ` Masahiro Yamada
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=1490692624-11931-2-git-send-email-yamada.masahiro@socionext.com \ --to=yamada.masahiro@socionext.com \ --cc=akpm@linux-foundation.org \ --cc=eric.y.miao@gmail.com \ --cc=haojian.zhuang@gmail.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux@armlinux.org.uk \ --cc=mturquette@baylibre.com \ --cc=ralf@linux-mips.org \ --cc=sboyd@codeaurora.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: linkBe 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.