From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Tian Tao <tiantao6@hisilicon.com>
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()
Date: Sat, 16 Jan 2021 12:37:46 +0100 [thread overview]
Message-ID: <20210116113746.e7gtlmblvsolygc2@earth.universe> (raw)
In-Reply-To: <1607994024-32199-1-git-send-email-tiantao6@hisilicon.com>
[-- Attachment #1: Type: text/plain, Size: 2619 bytes --]
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()
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> ---
Thanks, queued.
-- Sebastian
> drivers/power/supply/ds2780_battery.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> 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 file *filp,
> struct bin_attribute *bin_attr,
> char *buf, loff_t off, size_t count)
> {
> - struct device *dev = container_of(kobj, struct device, kobj);
> + struct device *dev = kobj_to_dev(kobj);
> struct power_supply *psy = to_power_supply(dev);
> struct ds2780_device_info *dev_info = to_ds2780_device_info(psy);
>
> @@ -637,7 +637,7 @@ static ssize_t ds2780_write_param_eeprom_bin(struct file *filp,
> struct bin_attribute *bin_attr,
> char *buf, loff_t off, size_t count)
> {
> - struct device *dev = container_of(kobj, struct device, kobj);
> + struct device *dev = kobj_to_dev(kobj);
> struct power_supply *psy = to_power_supply(dev);
> struct ds2780_device_info *dev_info = to_ds2780_device_info(psy);
> int ret;
> @@ -669,7 +669,7 @@ static ssize_t ds2780_read_user_eeprom_bin(struct file *filp,
> struct bin_attribute *bin_attr,
> char *buf, loff_t off, size_t count)
> {
> - struct device *dev = container_of(kobj, struct device, kobj);
> + struct device *dev = kobj_to_dev(kobj);
> struct power_supply *psy = to_power_supply(dev);
> struct ds2780_device_info *dev_info = to_ds2780_device_info(psy);
>
> @@ -682,7 +682,7 @@ static ssize_t ds2780_write_user_eeprom_bin(struct file *filp,
> struct bin_attribute *bin_attr,
> char *buf, loff_t off, size_t count)
> {
> - struct device *dev = container_of(kobj, struct device, kobj);
> + struct device *dev = kobj_to_dev(kobj);
> struct power_supply *psy = to_power_supply(dev);
> struct ds2780_device_info *dev_info = to_ds2780_device_info(psy);
> int ret;
> --
> 2.7.4
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2021-01-16 11:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-15 1:00 [PATCH] power: supply: ds2780: Switch to using the new API kobj_to_dev() Tian Tao
2021-01-16 11:37 ` Sebastian Reichel [this message]
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=20210116113746.e7gtlmblvsolygc2@earth.universe \
--to=sebastian.reichel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=tiantao6@hisilicon.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).