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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Ypc/x2G+jgHvBjLY@smile.fi.intel.com>
Date:   Wed, 1 Jun 2022 13:30:31 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Martin Blumenstingl <martin.blumenstingl@...glemail.com>
Cc:     linux-iio@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-amlogic@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Neil Armstrong <narmstrong@...libre.com>,
        Kevin Hilman <khilman@...libre.com>,
        Jerome Brunet <jbrunet@...libre.com>
Subject: Re: [PATCH v1 3/3] iio: adc: meson_saradc: Use temporary variable
 for struct device

On Tue, May 31, 2022 at 11:47:50PM +0200, Martin Blumenstingl wrote:
> On Tue, May 31, 2022 at 11:18 PM Andy Shevchenko
> <andriy.shevchenko@...ux.intel.com> wrote:
> [...]
> > @@ -650,11 +648,12 @@ static int meson_sar_adc_clk_init(struct iio_dev *indio_dev,
> >                                   void __iomem *base)
> >  {
> >         struct meson_sar_adc_priv *priv = iio_priv(indio_dev);
> > +       struct device *idev = &indio_dev->dev;
> > +       struct device *dev = dev->parent;
> It looks like this should read:
>     struct device *dev = idev->parent;

Oops, indeed.

> That said, I think this kind of typo is very easy with the current
> naming schema.
> It's been a while since I looked at other drivers but maybe the IIO
> maintainers have some recommendations for us (which would apply to
> multiple IIO drivers, not just meson_saradc).
> For example: I am not sure if iio_{err,warn} functions (which take a
> struct iio_dev pointer) have been proposed/discussed before. I think
> they could be useful for other drivers as well.

Looking deeper into this example, I think the IIO dev usage might be wrong
in the first place, but since there are managed resources attached, I dunno
if it's the way to go. Let's wait for maintainers to chime in.


-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ