Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp113910imm; Wed, 29 Aug 2018 15:34:43 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda4tCdB97A3ZitJu2qKFa2eGIs0bO1E5OO7mMjh5ILzSNFAnKvKlNaWowQ5GT7yUlay62io X-Received: by 2002:a17:902:934c:: with SMTP id g12-v6mr7597519plp.67.1535582083644; Wed, 29 Aug 2018 15:34:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535582083; cv=none; d=google.com; s=arc-20160816; b=zOGcPI1EbV/rMF7XSy489B433eiXmpS73lKKAjDb7r44n8KIRS6PotUXkIFIll1KlA y8q/W0udiY/qR2rxIHZB2SeWaBC7ZZ2W1iiOPpmtt8V37vpt2XvTyOnEN2sxIXm0WnkR g+LrG3XEOOs9dO0kcYaNOmb466oAFlegO536mgfG0nveqWz5/lSOUEN1nSRAwQDkuTAB VjSievDfEOmh9WqUe3aL2M3FqW28m2al5h/CfwmsCJkP5h/iwxFkPp6tJyz0bIS+z/s6 spUghXa7s+UHj0U7NHyAQcddDllA7raEYHtqJntUgjIQOpW3MjnZV4vJr1DMUICORDZE f4jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=LQN7fCDP/M2DHeMCfMa1ozHxPJHjKG2espGQgvEeHwY=; b=QPSooEnagtGnpM6ZPkoQWy2ysiVc+PJsUTFRAbAzotsgYaSnrpDhbyJR7XK66+RId2 uj0bP7JljJH8V7ELjJXIOqaB5KEqP4uyabyfBFMNWYFaUzAaU24jlZ80dWB8pROTuBE7 KDSKWrWrtwsdB19Dk4OB6B1kjQpxWDmG42NyTca5CmK5So+XEMamVSdmFVhpmaaTykUF PvIypEEShaqYivXEVgLdB+1EzLedMU1MTpFtsw7xSsHaYSU1kO9gG8UTowqmhH6lGKTo pL4DmSKJjH8jUxq7cCcF3nUagCrA6eKme+9Xknk3Nol2FUUIp5SptWAm7vA7ONtlwffp ambg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="hp0/w76s"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y86-v6si5001662pfi.195.2018.08.29.15.34.29; Wed, 29 Aug 2018 15:34:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="hp0/w76s"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727360AbeH3Cc0 (ORCPT + 99 others); Wed, 29 Aug 2018 22:32:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:59154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727179AbeH3Cc0 (ORCPT ); Wed, 29 Aug 2018 22:32:26 -0400 Received: from mail.kernel.org (unknown [185.216.33.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B79B520644; Wed, 29 Aug 2018 22:33:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1535582003; bh=VpOzEsjq7BnHpVB2u+LPjXwIXUQFtsPQKZaPW+iBu+k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hp0/w76sKyRhrXvz2hkw/jqHoqjgDwHBQzB1tNKV98DqYQHEDC9BBOwyL2dKbHvSe j+Jvz0bmOXQKgP2ERZnUxxyCX3p6ol13W+Tt5MUBxKD1tseoK5A1m7ixuBeK3SbRdN CIuhJb5+wyAzWCuGBiCsJpUALTn85XLX9/zwhF14= Date: Thu, 30 Aug 2018 00:33:20 +0200 From: Sebastian Reichel To: Ding Xiang Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] power: supply: ab8500_fg: fix obsolete function Message-ID: <20180829223320.rhfusyuywofjmpx7@earth.universe> References: <1535366955-12733-1-git-send-email-dingxiang@cmss.chinamobile.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="37hn7rqsvit6mk4s" Content-Disposition: inline In-Reply-To: <1535366955-12733-1-git-send-email-dingxiang@cmss.chinamobile.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --37hn7rqsvit6mk4s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon, Aug 27, 2018 at 06:49:15AM -0400, Ding Xiang wrote: > simple_strtoul is obsolete, and use kstrtoint instead >=20 > Signed-off-by: Ding Xiang > --- Thanks, queued. -- Sebastian > drivers/power/supply/ab8500_fg.c | 21 +++++++++++++++------ > 1 file changed, 15 insertions(+), 6 deletions(-) >=20 > diff --git a/drivers/power/supply/ab8500_fg.c b/drivers/power/supply/ab85= 00_fg.c > index 02356f9..2bdadb5 100644 > --- a/drivers/power/supply/ab8500_fg.c > +++ b/drivers/power/supply/ab8500_fg.c > @@ -2582,11 +2582,12 @@ static ssize_t ab8505_powercut_flagtime_write(str= uct device *dev, > const char *buf, size_t count) > { > int ret; > - long unsigned reg_value; > + int reg_value; > struct power_supply *psy =3D dev_get_drvdata(dev); > struct ab8500_fg *di =3D power_supply_get_drvdata(psy); > =20 > - reg_value =3D simple_strtoul(buf, NULL, 10); > + if (kstrtoint(buf, 10, ®_value)) > + goto fail; > =20 > if (reg_value > 0x7F) { > dev_err(dev, "Incorrect parameter, echo 0 (1.98s) - 127 (15.625ms) for= flagtime\n"); > @@ -2636,7 +2637,9 @@ static ssize_t ab8505_powercut_maxtime_write(struct= device *dev, > struct power_supply *psy =3D dev_get_drvdata(dev); > struct ab8500_fg *di =3D power_supply_get_drvdata(psy); > =20 > - reg_value =3D simple_strtoul(buf, NULL, 10); > + if (kstrtoint(buf, 10, ®_value)) > + goto fail; > + > if (reg_value > 0x7F) { > dev_err(dev, "Incorrect parameter, echo 0 (0.0s) - 127 (1.98s) for max= time\n"); > goto fail; > @@ -2684,7 +2687,9 @@ static ssize_t ab8505_powercut_restart_write(struct= device *dev, > struct power_supply *psy =3D dev_get_drvdata(dev); > struct ab8500_fg *di =3D power_supply_get_drvdata(psy); > =20 > - reg_value =3D simple_strtoul(buf, NULL, 10); > + if (kstrtoint(buf, 10, ®_value)) > + goto fail; > + > if (reg_value > 0xF) { > dev_err(dev, "Incorrect parameter, echo 0 - 15 for number of restart\n= "); > goto fail; > @@ -2777,7 +2782,9 @@ static ssize_t ab8505_powercut_write(struct device = *dev, > struct power_supply *psy =3D dev_get_drvdata(dev); > struct ab8500_fg *di =3D power_supply_get_drvdata(psy); > =20 > - reg_value =3D simple_strtoul(buf, NULL, 10); > + if (kstrtoint(buf, 10, ®_value)) > + goto fail; > + > if (reg_value > 0x1) { > dev_err(dev, "Incorrect parameter, echo 0/1 to disable/enable Pcut fea= ture\n"); > goto fail; > @@ -2849,7 +2856,9 @@ static ssize_t ab8505_powercut_debounce_write(struc= t device *dev, > struct power_supply *psy =3D dev_get_drvdata(dev); > struct ab8500_fg *di =3D power_supply_get_drvdata(psy); > =20 > - reg_value =3D simple_strtoul(buf, NULL, 10); > + if (kstrtoint(buf, 10, ®_value)) > + goto fail; > + > if (reg_value > 0x7) { > dev_err(dev, "Incorrect parameter, echo 0 to 7 for debounce setting\n"= ); > goto fail; > --=20 > 1.8.3.1 >=20 >=20 >=20 --37hn7rqsvit6mk4s Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAluHHzAACgkQ2O7X88g7 +ppnEA//f6e2u3qwcvI1Eh6rrXjU/ST9096xpUNfHttE/gilKC5gQOU3V1qKV1lt 7L7OOMQGZZRAIdVz0mSPckryW3d/d+Tn3xqzzHO9VpV0SQmo+GcNTxOAIIJ7giPr uXU6/YEVTBHm5kt7dkbTqhOJqq7dMGDYMd0dDTXl+aT/PyEAStL0ybGvHmQsFIap 2xVMzTkpkQWjPw9Ffm5yL4FZEFKc3tdPl0tCgOKRTW8zsO0u2VrDBveF+YFWJUM2 aiP54r56YbEPMTxsDO4gxY/QKOzwklIW+7BEH4RyGBkYhlJOYg9eGhZQ+Ca4JQ9H 9+i4yfrqbPgP8HFnPl0/EbuXGBfSjbf1xmu0efPhJZNhgE/mIG3w5qhVf0RgzGHz 7L5gmyaAGc32s2+jPMDQs8WJxI6TrwkJyRGRsK3r6DrUP/NTqzzW+DCaWFFSe/15 5P5qAUjxYku5626Em9vrQPRd5appDwCU470WYpHz73wzo9f7IqLXx1Ni8lVf4d3C RDr5S90M10xP6M7SDxpNFqnPNZzKxkWV5L6Z3tDBMCxkTuUPsfsZl4tsR0AiTdVt 25i590tMGlUBEPlaOxd/I7/TuGKa4ERIha5D+PsiS+GDytAqblJ70ok99jUdVSyt f3bZMofVrT+9JTRkkXGgBB1xaA1z2fmDqAAFxTJWxHQaudmBsgY= =Mvg/ -----END PGP SIGNATURE----- --37hn7rqsvit6mk4s--