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: <CAHp75VdUkVQJOebA3V+F734e5hXO3XWFAT0HVQqKdCQgPbqdNA@mail.gmail.com>
Date:   Mon, 14 Feb 2022 13:22:32 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Jagath Jog J <jagathjog1996@...il.com>
Cc:     Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Slawomir Stepien <sst@...zta.fm>,
        Rob Herring <robh+dt@...nel.org>,
        linux-iio <linux-iio@...r.kernel.org>,
        devicetree <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/4] iio: potentiometer: Add available functionality

On Mon, Feb 14, 2022 at 5:36 AM Jagath Jog J <jagathjog1996@...il.com> wrote:
>
> Adding available functionality for ds1803 driver which
> will show the minimum, step and maximum values
> it can accepts through sysfs entry.

accept

...

>  struct ds1803_cfg {
>         int kohms;
> +       int avail[3];
>  };
>
>  static const struct ds1803_cfg ds1803_cfg[] = {
> -       [DS1803_010] = { .kohms =  10, },
> -       [DS1803_050] = { .kohms =  50, },
> -       [DS1803_100] = { .kohms = 100, },
> +       [DS1803_010] = { .avail = { 0, 1, 255 }, .kohms =  10, },
> +       [DS1803_050] = { .avail = { 0, 1, 255 }, .kohms =  50, },
> +       [DS1803_100] = { .avail = { 0, 1, 255 }, .kohms = 100, },
>  };

Please, do it rather with additional data:

static const int ds1803_range[] = { ... };

   .avail = ..._range,

Also, looking into the next patch, can you move the structure to the
place where it's more appropriate?

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ