Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp675759pxb; Sat, 16 Jan 2021 03:42:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPcdXULOtTHCwHJCjCFcnixXpwnI9jneOBtOK4bwDAbAhseh4KA1qDMkkyrEJfwhvGh4YB X-Received: by 2002:a50:d6dc:: with SMTP id l28mr13370163edj.105.1610797361518; Sat, 16 Jan 2021 03:42:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610797361; cv=none; d=google.com; s=arc-20160816; b=lXTWmkJMsE/9rvlG2LZNZYMQHoCHFigHq4wyQIKzeFdlwgrMCF7TBK+MY6z6Xcb3QW euyDnXkqaieo+Qua2sdUbdU+ck7YMGFubIA3vJQEXyRXKMv7leHB5iWAEtcoAFHu0b6b 3oupfuwGBm2h8n1VvOYrodGsb30tq0EyHmvFVxE+BC+uuytXQ1Yf4Qi35sf2HVpsjpnB RHx8HzVu+xeNeWFPMOV6p1M7SabNfYBIImrCDKBmtI4+ix0TVDT9Mt/+UQs3l4N7ATc4 JTAE6yDGWl3Fr/Z6M/ztZVZSl9ib/CW072KfZjMw0NjCYl5bRWd4WPh0tIAHWvpo4Tlo L5Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=tiMpTBoA/4N3L5jjpnJTPpV2ooH15sS9o/iA8szIedw=; b=EPr1nyO7Dt3WkflDW09ZcQAM2tPRDheGkOYBAcYKXrpWEMdyDpHwVVif8G6U2tAj3q s/3b5e7SzS2gjCHsyHUYodG/YJ7t3/1ct1nM0lSYBtLpt0YET/u5deMpmUR97Zpadd0H eMt4oV98qgH/IujMvjoAHquaPuL6gDeWC3n9JkNHxPfkD+x2Dce7R8JaaBlY6JicbEH/ 9b//+3xlzcKxaKLISbd2rhhlfreUXpFdtHlK2VMQv6Z4o3uiw2YIZMYgsc7fd6PRYfzR PXiosR99TYfzVzWkNwFSA1yprexwY3ZU4JzuRYr5IuegEEf7n0ySqcCCXspYen186VWp nNgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 25si300907ejw.605.2021.01.16.03.41.46; Sat, 16 Jan 2021 03:42:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726440AbhAPLib (ORCPT + 99 others); Sat, 16 Jan 2021 06:38:31 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:47858 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726025AbhAPLia (ORCPT ); Sat, 16 Jan 2021 06:38:30 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 205A81F458E8 Received: by earth.universe (Postfix, from userid 1000) id 5C8A33C0C94; Sat, 16 Jan 2021 12:37:46 +0100 (CET) Date: Sat, 16 Jan 2021 12:37:46 +0100 From: Sebastian Reichel To: Tian Tao Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] power: supply: ds2780: Switch to using the new API kobj_to_dev() Message-ID: <20210116113746.e7gtlmblvsolygc2@earth.universe> References: <1607994024-32199-1-git-send-email-tiantao6@hisilicon.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="whse6vmqu653lut3" Content-Disposition: inline In-Reply-To: <1607994024-32199-1-git-send-email-tiantao6@hisilicon.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --whse6vmqu653lut3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Tue, Dec 15, 2020 at 09:00:24AM +0800, Tian Tao wrote: > fixed the following coccicheck: > drivers/power/supply/ds2780_battery.c:627:60-61: WARNING opportunity for > kobj_to_dev() > drivers/power/supply/ds2780_battery.c:672:60-61: WARNING opportunity for > kobj_to_dev() > drivers/power/supply/ds2780_battery.c:640:60-61: WARNING opportunity for > kobj_to_dev() > drivers/power/supply/ds2780_battery.c:685:60-61: WARNING opportunity for > kobj_to_dev() >=20 > Signed-off-by: Tian Tao > --- Thanks, queued. -- Sebastian > drivers/power/supply/ds2780_battery.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/power/supply/ds2780_battery.c b/drivers/power/supply= /ds2780_battery.c > index dd57a47..2b8c90d 100644 > --- a/drivers/power/supply/ds2780_battery.c > +++ b/drivers/power/supply/ds2780_battery.c > @@ -624,7 +624,7 @@ static ssize_t ds2780_read_param_eeprom_bin(struct fi= le *filp, > struct bin_attribute *bin_attr, > char *buf, loff_t off, size_t count) > { > - struct device *dev =3D container_of(kobj, struct device, kobj); > + struct device *dev =3D kobj_to_dev(kobj); > struct power_supply *psy =3D to_power_supply(dev); > struct ds2780_device_info *dev_info =3D to_ds2780_device_info(psy); > =20 > @@ -637,7 +637,7 @@ static ssize_t ds2780_write_param_eeprom_bin(struct f= ile *filp, > struct bin_attribute *bin_attr, > char *buf, loff_t off, size_t count) > { > - struct device *dev =3D container_of(kobj, struct device, kobj); > + struct device *dev =3D kobj_to_dev(kobj); > struct power_supply *psy =3D to_power_supply(dev); > struct ds2780_device_info *dev_info =3D to_ds2780_device_info(psy); > int ret; > @@ -669,7 +669,7 @@ static ssize_t ds2780_read_user_eeprom_bin(struct fil= e *filp, > struct bin_attribute *bin_attr, > char *buf, loff_t off, size_t count) > { > - struct device *dev =3D container_of(kobj, struct device, kobj); > + struct device *dev =3D kobj_to_dev(kobj); > struct power_supply *psy =3D to_power_supply(dev); > struct ds2780_device_info *dev_info =3D to_ds2780_device_info(psy); > =20 > @@ -682,7 +682,7 @@ static ssize_t ds2780_write_user_eeprom_bin(struct fi= le *filp, > struct bin_attribute *bin_attr, > char *buf, loff_t off, size_t count) > { > - struct device *dev =3D container_of(kobj, struct device, kobj); > + struct device *dev =3D kobj_to_dev(kobj); > struct power_supply *psy =3D to_power_supply(dev); > struct ds2780_device_info *dev_info =3D to_ds2780_device_info(psy); > int ret; > --=20 > 2.7.4 >=20 --whse6vmqu653lut3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmAC0AUACgkQ2O7X88g7 +prqlhAAi0RthW4Ac5Mw1MsiSP1Qv1Xm9hxMEshztQd3w0za/AgKTVaHf4QZylrS Tt08CUwKDF1HDolnQjEtuLi2cLwYMrCbbCuwyUpL7FVexYc3JaiYjd4wrxgU1sN7 U8D4EIr4PZe0mi5joFG3uAPRdW7Xvu49dWZoeVNbdTueBiQwsllXw38lkSPOtbz4 59oASOPiFjJVhdLSEj0tyoUlQw6oEA+niU0d405d38bK14Z4RjjkU4Kfipk/8Pfj xNz3SuX8xE1OZlH6Qux8YAERFcZOuF864rPMiLlyBHdOxmIUpZBujyko5cSWuB9h iq/i+26AJOa4A41dRBAwh1hMJA1fyPGdfNW6MN2zawnATdSjovpDdmJ6OKie870q Ok9tVCPsEGyTKF2iifyJeTDG81L3gNNONbNLpFRdhzeippYaudjUHZuehBKOrHK9 atctXuXSkjBzuUXpBtFdtpkRvV7dlwzuirJ0cpj9vFz7/ZGBhX86rmKZF/xFe9AN BkFEkIde2aTAhzt3wsATPyYKnNlaCSWOwtET/XxsYm5Ldi4l9b6kj3ui42y0URdf hq3mF6K2uPw+RfuF5PwAvLapy9cx5PGHf1giaKYYWUjX4Wj6TwHflgQYz9335gio V+HZKD4lOSqDDq9ZcV/hkcPd21Xf4WYgm4XpR7W9Upo+wze/kQ8= =woPi -----END PGP SIGNATURE----- --whse6vmqu653lut3--