linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Valentin <edubezval@gmail.com>
To: kbuild test robot <fengguang.wu@intel.com>
Cc: Javi Merino <javi.merino@arm.com>,
	kbuild-all@01.org, Kapileshwar Singh <kapileshwar.singh@arm.com>,
	Punit Agrawal <punit.agrawal@arm.com>,
	Zhang Rui <rui.zhang@intel.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] thermal: cpu_cooling: fix ptr_ret.cocci warnings
Date: Thu, 5 Mar 2015 00:46:13 -0400	[thread overview]
Message-ID: <20150305044611.GA3632@developer.hsd1.ca.comcast.net> (raw)
In-Reply-To: <20150304203402.GA168719@athens.lkp.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1809 bytes --]

On Thu, Mar 05, 2015 at 04:34:02AM +0800, kbuild test robot wrote:
> drivers/thermal/cpu_cooling.c:463:18-24: WARNING: PTR_ERR_OR_ZERO can be used
> 
> 
>  Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
> 
> Generated by: scripts/coccinelle/api/ptr_ret.cocci
> 
> CC: Javi Merino <javi.merino@arm.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
> 
>  cpu_cooling.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/drivers/thermal/cpu_cooling.c
> +++ b/drivers/thermal/cpu_cooling.c
> @@ -460,7 +460,7 @@ static int get_static_power(struct cpufr
>  	if (voltage == 0) {
>  		dev_warn_ratelimited(cpufreq_device->cpu_dev,
>  				     "Failed to get voltage for frequency %lu: %ld\n",
> -				     freq_hz, IS_ERR(opp) ? PTR_ERR(opp) : 0);
> +				     freq_hz, PTR_ERR_OR_ZERO(opp));

This patch causes this compilation warning.

In file included from include/linux/device.h:27:0,
                 from include/linux/thermal.h:30,
                 from drivers/thermal/cpu_cooling.c:26:
drivers/thermal/cpu_cooling.c: In function ‘get_static_power’:
include/linux/ratelimit.h:31:9: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘int’ [-Wformat=]
  struct ratelimit_state name =     \
         ^
include/linux/device.h:1162:9: note: in expansion of macro ‘DEFINE_RATELIMIT_STATE’
  static DEFINE_RATELIMIT_STATE(_rs,    \
         ^
include/linux/device.h:1178:2: note: in expansion of macro ‘dev_level_ratelimited’
  dev_level_ratelimited(dev_warn, dev, fmt, ##__VA_ARGS__)
  ^
drivers/thermal/cpu_cooling.c:463:3: note: in expansion of macro ‘dev_warn_ratelimited’
   dev_warn_ratelimited(cpufreq_device->cpu_dev,
   ^

>  		return -EINVAL;
>  	}
>  

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-03-05  4:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201503050401.EJ55ouQ7%fengguang.wu@intel.com>
2015-03-04 20:34 ` [PATCH] thermal: cpu_cooling: fix ptr_ret.cocci warnings kbuild test robot
2015-03-05  4:46   ` Eduardo Valentin [this message]
2015-03-05 10:48     ` Javi Merino

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=20150305044611.GA3632@developer.hsd1.ca.comcast.net \
    --to=edubezval@gmail.com \
    --cc=fengguang.wu@intel.com \
    --cc=javi.merino@arm.com \
    --cc=kapileshwar.singh@arm.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=punit.agrawal@arm.com \
    --cc=rui.zhang@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).