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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210811081138.GA4951@mugil-Nitro-AN515-52>
Date:   Wed, 11 Aug 2021 13:41:38 +0530
From:   Mugilraj Dhavachelvan <dmugil2000@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     "Bogdan, Dragos" <Dragos.Bogdan@...log.com>,
        Darius <Darius.Berghe@...log.com>,
        Rob Herring <robh+dt@...nel.org>,
        Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Michael Hennerich <Michael.Hennerich@...log.com>,
        Guenter Roeck <linux@...ck-us.net>,
        Chris Packham <chris.packham@...iedtelesis.co.nz>,
        Slawomir Stepien <sst@...zta.fm>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        devicetree <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-iio <linux-iio@...r.kernel.org>
Subject: Re: [PATCH v2 2/2] iio: potentiometer: Add driver support for AD5110

On Wed, Aug 11, 2021 at 10:05:41AM +0300, Andy Shevchenko wrote:
> On Wed, Aug 11, 2021 at 10:03 AM Andy Shevchenko
> <andy.shevchenko@...il.com> wrote:
> > On Wed, Aug 11, 2021 at 8:46 AM Mugilraj Dhavachelvan
> > <dmugil2000@...il.com> wrote:
> > > On Tue, Aug 10, 2021 at 03:49:52PM +0300, Andy Shevchenko wrote:
> > > > On Mon, Aug 9, 2021 at 10:59 AM Mugilraj Dhavachelvan
> > > > <dmugil2000@...il.com> wrote:
> >
> > ...
> >
> > > > > +       data->tol = data->cfg->kohms * (val & GENMASK(6, 0)) * 10 / 8;
> > > > > +       if (!(val & BIT(7)))
> > > > > +               data->tol *= -1;
> > > >
> > > > Shouldn't you simple use corresponding sign_extend*()?
> > > >
> > > I'm not able see any sign_extend for 16 bit. Is there any other way?
> >
> > So, then add it in bitops.h the same way it's done for s32 and s64.
> 
> In case you are afraid that this will delay patches and you are in a
> hurry, you may define it locally (but in the very same way, so
> somebody can make it generic). Nevertheless, I think this one can be
> added directly to the generic header, it will definitely have more
> than one user.
> 
It seems like we can use sign_extend32() for 16 and 8 bit as well.
> > ...
> >
> > > > > +       if (!data->cfg)
> > > > > +               data->cfg = &ad5110_cfg[i2c_match_id(ad5110_id, client)->driver_data];
> > > >
> > > > Not sure this is not a dead code since you are using ->probe_new().
> > > >
> > > Even I'm suspecting that and also removing id_table. But I'm not sure of
> > > it so just left as it is.
> >
> > I²C ID table is good to have without direct use, but ->probe_new() is
> > called if and only if there is a compatible string or ACPI ID match.
> > In such case data->cfg may be NULL if and only if the corresponding
> > table missed it, but this will be a bug anyway, so the above code will
> > rather hide the bug. Hence, please remove it.
> 
> 
> 
> -- 
> With Best Regards,
> Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ