All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>,
	Kukjin Kim <kgene.kim@samsung.com>,
	linux-pm@vger.kernel.org, Viresh Kumar <viresh.kumar@linaro.org>,
	linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	linux-samsung-soc@vger.kernel.org,
	Thomas Abraham <thomas.abraham@linaro.org>,
	Inderpal Singh <inderpal.singh@linaro.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V3 1/4] cpufreq: exynos: Adding cpufreq driver for exynos5440
Date: Thu, 7 Mar 2013 15:37:36 +0000	[thread overview]
Message-ID: <20130307153736.GC4977@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <5138B200.7060906@samsung.com>

On Thu, Mar 07, 2013 at 04:28:00PM +0100, Sylwester Nawrocki wrote:
> On 03/07/2013 05:13 AM, Amit Daniel Kachhap wrote:
> > +	dvfs_info->cpu_clk = devm_clk_get(dvfs_info->dev, "armclk");
> > +	if (IS_ERR_OR_NULL(dvfs_info->cpu_clk)) {
> 
> devm_clk_get() return value needs to be checked with IS_ERR(),
> not IS_ERR_OR_NULL().
> 
> > +		pr_err("Failed to get cpu clock\n");
> > +		ret = PTR_ERR(dvfs_info->cpu_clk);
> > +		goto err_free_table;

Amit, to illustrate why this is wrong, consider this:
1. Set cpu_clk to NULL.
2. Realise IS_ERR_OR_NULL(NULL) is true.
3. What is the value of PTR_ERR(NULL) ?
4. What effect does that have when you jump to err_free_table ?
5. What value is returned from this function in that case ?
6. What does that return value mean to the driver core ?

WARNING: multiple messages have this Message-ID (diff)
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V3 1/4] cpufreq: exynos: Adding cpufreq driver for exynos5440
Date: Thu, 7 Mar 2013 15:37:36 +0000	[thread overview]
Message-ID: <20130307153736.GC4977@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <5138B200.7060906@samsung.com>

On Thu, Mar 07, 2013 at 04:28:00PM +0100, Sylwester Nawrocki wrote:
> On 03/07/2013 05:13 AM, Amit Daniel Kachhap wrote:
> > +	dvfs_info->cpu_clk = devm_clk_get(dvfs_info->dev, "armclk");
> > +	if (IS_ERR_OR_NULL(dvfs_info->cpu_clk)) {
> 
> devm_clk_get() return value needs to be checked with IS_ERR(),
> not IS_ERR_OR_NULL().
> 
> > +		pr_err("Failed to get cpu clock\n");
> > +		ret = PTR_ERR(dvfs_info->cpu_clk);
> > +		goto err_free_table;

Amit, to illustrate why this is wrong, consider this:
1. Set cpu_clk to NULL.
2. Realise IS_ERR_OR_NULL(NULL) is true.
3. What is the value of PTR_ERR(NULL) ?
4. What effect does that have when you jump to err_free_table ?
5. What value is returned from this function in that case ?
6. What does that return value mean to the driver core ?

  reply	other threads:[~2013-03-07 15:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07  4:13 [PATCH V3 1/4] cpufreq: exynos: Adding cpufreq driver for exynos5440 Amit Daniel Kachhap
2013-03-07  4:13 ` Amit Daniel Kachhap
2013-03-07  4:13 ` [PATCH V3 2/4] cpufreq: exynos: Remove error return even if no soc is found Amit Daniel Kachhap
2013-03-07  4:13   ` Amit Daniel Kachhap
2013-03-07  4:13 ` [PATCH V3 3/4] arm: exynos: Enable OPP library support for exynos5440 Amit Daniel Kachhap
2013-03-07  4:13   ` Amit Daniel Kachhap
2013-03-07  4:13 ` [PATCH V3 4/4] dts: Add cpufreq controller node for Exynos5440 SoC Amit Daniel Kachhap
2013-03-07  4:13   ` Amit Daniel Kachhap
2013-03-07 15:28 ` [PATCH V3 1/4] cpufreq: exynos: Adding cpufreq driver for exynos5440 Sylwester Nawrocki
2013-03-07 15:28   ` Sylwester Nawrocki
2013-03-07 15:37   ` Russell King - ARM Linux [this message]
2013-03-07 15:37     ` Russell King - ARM Linux
2013-03-11  3:44     ` amit kachhap
2013-03-11  3:44       ` amit kachhap
2013-03-11  3:43   ` amit kachhap
2013-03-11  3:43     ` amit kachhap
2013-03-09 10:47 ` Viresh Kumar
2013-03-09 10:47   ` Viresh Kumar
2013-03-11  3:45   ` amit kachhap
2013-03-11  3:45     ` amit kachhap

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=20130307153736.GC4977@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=amit.daniel@samsung.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=inderpal.singh@linaro.org \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=s.nawrocki@samsung.com \
    --cc=thomas.abraham@linaro.org \
    --cc=viresh.kumar@linaro.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.