From: "tiantao (H)" <tiantao6@huawei.com>
To: Greg KH <gregkh@linuxfoundation.org>, Tian Tao <tiantao6@hisilicon.com>
Cc: <zbr@ioremap.net>, <rikard.falkeborn@gmail.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] w1: ds2708 and ds2781 use the new API kobj_to_dev()
Date: Tue, 2 Mar 2021 08:51:08 +0800 [thread overview]
Message-ID: <9be69246-fb8b-27dc-c459-0f9aa25c5c88@huawei.com> (raw)
In-Reply-To: <YDzne3KtnGJD1J0E@kroah.com>
Hi:
在 2021/3/1 21:09, Greg KH 写道:
> On Mon, Mar 01, 2021 at 08:58:55PM +0800, Tian Tao wrote:
>> fix the below warnning:
>> /drivers/w1/slaves/w1_ds2780.c:93:60-61: WARNING opportunity for
>> kobj_to_dev()
> What creates that warning?
This is reported by coccicheck.
>
>
>> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
>> ---
>> drivers/w1/slaves/w1_ds2780.c | 3 ++-
>> drivers/w1/slaves/w1_ds2781.c | 2 +-
>> 2 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/w1/slaves/w1_ds2780.c b/drivers/w1/slaves/w1_ds2780.c
>> index c281fe5..3cde1bb 100644
>> --- a/drivers/w1/slaves/w1_ds2780.c
>> +++ b/drivers/w1/slaves/w1_ds2780.c
>> @@ -90,7 +90,8 @@ static ssize_t w1_slave_read(struct file *filp, struct kobject *kobj,
>> 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);
>> +
> Why the extra line here, but not in the other chunk?
This is reported by checkpatch.
tiantao@ubuntu:~/mailline/linux-next$ ./scripts/checkpatch.pl
drivers/w1/slaves/w1_ds2780.c
WARNING: Missing a blank line after declarations
#94: FILE: drivers/w1/slaves/w1_ds2780.c:94:
+ struct device *dev = kobj_to_dev(kobj);
+ return w1_ds2780_io(dev, buf, off, count, 0);
>
> Consistancy is key :)
>
> Please fix up.
>
> thanks,
>
> greg k-h
> .
>
next prev parent reply other threads:[~2021-03-02 7:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-01 12:58 Tian Tao
2021-03-01 13:09 ` Greg KH
2021-03-02 0:51 ` tiantao (H) [this message]
2021-03-02 5:37 ` Greg KH
2021-03-02 6:17 Tian Tao
2021-03-02 6:27 ` Greg KH
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=9be69246-fb8b-27dc-c459-0f9aa25c5c88@huawei.com \
--to=tiantao6@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rikard.falkeborn@gmail.com \
--cc=tiantao6@hisilicon.com \
--cc=zbr@ioremap.net \
/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
all inboxes | Powered by JetHome®