lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 2 Mar 2021 06:37:06 +0100
From:   Greg KH <gregkh@...uxfoundation.org>
To:     "tiantao (H)" <tiantao6@...wei.com>
Cc:     Tian Tao <tiantao6@...ilicon.com>, zbr@...emap.net,
        rikard.falkeborn@...il.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] w1: ds2708 and ds2781 use the new API kobj_to_dev()

On Tue, Mar 02, 2021 at 08:51:08AM +0800, tiantao (H) wrote:
> 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.

Then include that in the changelog text, otherwise this looks like a
warning by the complier, which it is not.

> > > Signed-off-by: Tian Tao <tiantao6@...ilicon.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@...ntu:~/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);

Yes, but you made this change in only one of the hunks, and not the
other.

And, it is a different type of change, only do one "logical" thing per
patch.  This should be a 2 patch series if you care about the coding
style of this driver.

Please fix up and resend.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ