From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752026AbbCEEpY (ORCPT ); Wed, 4 Mar 2015 23:45:24 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:43885 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751066AbbCEEpW (ORCPT ); Wed, 4 Mar 2015 23:45:22 -0500 Date: Thu, 5 Mar 2015 00:46:13 -0400 From: Eduardo Valentin To: kbuild test robot Cc: Javi Merino , kbuild-all@01.org, Kapileshwar Singh , Punit Agrawal , Zhang Rui , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] thermal: cpu_cooling: fix ptr_ret.cocci warnings Message-ID: <20150305044611.GA3632@developer.hsd1.ca.comcast.net> References: <201503050401.EJ55ouQ7%fengguang.wu@intel.com> <20150304203402.GA168719@athens.lkp.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bp/iNruPH9dso1Pn" Content-Disposition: inline In-Reply-To: <20150304203402.GA168719@athens.lkp.intel.com> User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --bp/iNruPH9dso1Pn Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 >=20 >=20 > Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR >=20 > Generated by: scripts/coccinelle/api/ptr_ret.cocci >=20 > CC: Javi Merino > Signed-off-by: Fengguang Wu > --- >=20 > cpu_cooling.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > --- 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 =3D=3D 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 =E2=80=98get_static_power=E2=80= =99: include/linux/ratelimit.h:31:9: warning: format =E2=80=98%ld=E2=80=99 expec= ts argument of type =E2=80=98long int=E2=80=99, but argument 4 has type =E2= =80=98int=E2=80=99 [-Wformat=3D] struct ratelimit_state name =3D \ ^ include/linux/device.h:1162:9: note: in expansion of macro =E2=80=98DEFINE_= RATELIMIT_STATE=E2=80=99 static DEFINE_RATELIMIT_STATE(_rs, \ ^ include/linux/device.h:1178:2: note: in expansion of macro =E2=80=98dev_lev= el_ratelimited=E2=80=99 dev_level_ratelimited(dev_warn, dev, fmt, ##__VA_ARGS__) ^ drivers/thermal/cpu_cooling.c:463:3: note: in expansion of macro =E2=80=98d= ev_warn_ratelimited=E2=80=99 dev_warn_ratelimited(cpufreq_device->cpu_dev, ^ > return -EINVAL; > } > =20 --bp/iNruPH9dso1Pn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJU99+LAAoJEMLUO4d9pOJW+soH/0ykguvUxR33o2FWKUAsPBHF NvHWyLrpBNHtAMAuUrvkU788ok6sYBCcNikuOOwmLYwWm62sj+55JqSXDZVt8z5N rZeqU2UeYrv/PFtslHKxXMII11JiZ0Y0CG4nloHrB8kpNPeiGx31a2/pbw/1WUuT Ku+EyFc9eqEJYHhIoBDNHm3EHqxzyEXP4EH4m/kXn/IU4l058WD1HzFr4CAvfM0q ZeNyQ2nuwarcnMn+XNju8O5VrpDLyav3SG6nLmseQZGCCRycRbPrRH7/qyLWNE01 79ykq61XsFzO3NJdMDcMJ3bu43NJpRSjvXSHKsbtvFDDUTV6ZwwJjEPVkk1jq5M= =oKRf -----END PGP SIGNATURE----- --bp/iNruPH9dso1Pn--