From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Wei Yongjun <weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
pdeschrijver-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org,
pgaikwad-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
Cc: yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] clk: tegra: fix return value check in tegra_clk_register_pllc()
Date: Tue, 29 Oct 2013 13:40:26 -0600 [thread overview]
Message-ID: <52700F2A.1080004@wwwdotorg.org> (raw)
In-Reply-To: <CAPgLHd-wYa3Z7J93LmC0rvRPKsrjK+8DEZR+2f+e14RN+p_fPg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 10/28/2013 08:07 PM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.org>
>
> In case of error, the function __clk_lookup() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should
> be replaced with NULL test.
> parent = __clk_lookup(parent_name);
> - if (IS_ERR(parent)) {
> + if (!parent) {
clk_get() returns an error-value. It'd be nice if the internal clk APIs
all did the same for consistency... Otherwise, the clock subsystem is
essentially using both NULL and error-values as errors, which is rather
frowned upon.
WARNING: multiple messages have this Message-ID (diff)
From: swarren@wwwdotorg.org (Stephen Warren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clk: tegra: fix return value check in tegra_clk_register_pllc()
Date: Tue, 29 Oct 2013 13:40:26 -0600 [thread overview]
Message-ID: <52700F2A.1080004@wwwdotorg.org> (raw)
In-Reply-To: <CAPgLHd-wYa3Z7J93LmC0rvRPKsrjK+8DEZR+2f+e14RN+p_fPg@mail.gmail.com>
On 10/28/2013 08:07 PM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> In case of error, the function __clk_lookup() returns NULL pointer
> not ERR_PTR(). The IS_ERR() test in the return value check should
> be replaced with NULL test.
> parent = __clk_lookup(parent_name);
> - if (IS_ERR(parent)) {
> + if (!parent) {
clk_get() returns an error-value. It'd be nice if the internal clk APIs
all did the same for consistency... Otherwise, the clock subsystem is
essentially using both NULL and error-values as errors, which is rather
frowned upon.
next prev parent reply other threads:[~2013-10-29 19:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-29 2:07 [PATCH] clk: tegra: fix return value check in tegra_clk_register_pllc() Wei Yongjun
2013-10-29 2:07 ` Wei Yongjun
[not found] ` <CAPgLHd-wYa3Z7J93LmC0rvRPKsrjK+8DEZR+2f+e14RN+p_fPg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-10-29 19:40 ` Stephen Warren [this message]
2013-10-29 19:40 ` Stephen Warren
2013-11-28 13:10 ` Peter De Schrijver
2013-11-28 13:10 ` Peter De Schrijver
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=52700F2A.1080004@wwwdotorg.org \
--to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=pdeschrijver-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=pgaikwad-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=yongjun_wei-zrsr2BFq86L20UzCJQGyNP8+0UxHXcjY@public.gmane.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: link
Be 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.