public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Stephen Boyd <sboyd@codeaurora.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] PM / OPP: passing NULL to PTR_ERR()
Date: Mon, 21 Sep 2015 11:59:39 -0700	[thread overview]
Message-ID: <20150921185939.GB24314@linux> (raw)
In-Reply-To: <20150921162602.GE5648@mwanda>

On 21-09-15, 19:26, Dan Carpenter wrote:
> The code was using PTR_ERR(NULL) which causes a static checker warning.
> I have fixed up the printks and changed the return to -ENOENT.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/base/power/opp/cpu.c b/drivers/base/power/opp/cpu.c
> index 3d946b5..7654c56 100644
> --- a/drivers/base/power/opp/cpu.c
> +++ b/drivers/base/power/opp/cpu.c
> @@ -223,8 +223,7 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask
>  	/* Get OPP descriptor node */
>  	np = _of_get_opp_desc_node(cpu_dev);
>  	if (!np) {
> -		dev_dbg(cpu_dev, "%s: Couldn't find opp node: %ld\n", __func__,
> -			PTR_ERR(np));
> +		dev_dbg(cpu_dev, "%s: Couldn't find cpu_dev node.\n", __func__);
>  		return -ENOENT;
>  	}
>  
> @@ -247,9 +246,9 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, cpumask_var_t cpumask
>  		/* Get OPP descriptor node */
>  		tmp_np = _of_get_opp_desc_node(tcpu_dev);
>  		if (!tmp_np) {
> -			dev_err(tcpu_dev, "%s: Couldn't find opp node: %ld\n",
> -				__func__, PTR_ERR(tmp_np));
> -			ret = PTR_ERR(tmp_np);
> +			dev_err(tcpu_dev, "%s: Couldn't find tcpu_dev node.\n",
> +				__func__);
> +			ret = -ENOENT;
>  			goto put_cpu_node;
>  		}

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

  reply	other threads:[~2015-09-21 18:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-21 16:26 [patch] PM / OPP: passing NULL to PTR_ERR() Dan Carpenter
2015-09-21 18:59 ` Viresh Kumar [this message]
2015-09-25 21:55   ` Rafael J. Wysocki

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=20150921185939.GB24314@linux \
    --to=viresh.kumar@linaro.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=len.brown@intel.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox