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]
Message-ID: <20171109113659.76ide6wvqaxcjx5a@mwanda>
Date:   Thu, 9 Nov 2017 15:54:57 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Gilad Ben-Yossef <gilad@...yossef.com>
Cc:     devel@...verdev.osuosl.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        driverdev-devel@...uxdriverproject.org,
        Linux kernel mailing list <linux-kernel@...r.kernel.org>,
        Linux Crypto Mailing List <linux-crypto@...r.kernel.org>,
        Ofir Drang <ofir.drang@....com>
Subject: Re: [PATCH 6/8] staging: ccree: simplify pm manager using local var

On Thu, Nov 09, 2017 at 08:27:28AM +0200, Gilad Ben-Yossef wrote:
> On Tue, Nov 7, 2017 at 12:43 PM, Dan Carpenter <dan.carpenter@...cle.com> wrote:
> > On Tue, Nov 07, 2017 at 09:40:02AM +0000, Gilad Ben-Yossef wrote:
> >> --- a/drivers/staging/ccree/ssi_pm.c
> >> +++ b/drivers/staging/ccree/ssi_pm.c
> >> @@ -90,20 +90,24 @@ int cc_pm_resume(struct device *dev)
> >>  int cc_pm_get(struct device *dev)
> >>  {
> >>       int rc = 0;
> >> +     struct ssi_drvdata *drvdata =
> >> +             (struct ssi_drvdata *)dev_get_drvdata(dev);
> >
> > No need to cast:
> >
> >         struct ssi_drvdata *drvdata = dev_get_drvdata(dev);
> >
> 
> The same unneeded cast appears at other places in the file, so I opted
> to add a patch addressing all these location rather then change this one.
> 
> I hope it's OK.

I don't care about this one patch, it's fine.  But generally and for
future reference, we don't try very hard to use a consistent style
within a driver.  The preference is almost always kernel style over
driver style so new code should always be "kernel style" where
we avoid casting from kmalloc() or other functions that return void
pointers.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ