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: <CAHp75VfC7UzKx1i0aTRTZO2REe=PET3turKzH_iuUzWvTJZOtg@mail.gmail.com>
Date:   Mon, 24 Jan 2022 15:03:18 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     LI Qingwu <Qing-wu.Li@...ca-geosystems.com.cn>
Cc:     Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Rob Herring <robh+dt@...nel.org>,
        Tomas Melin <tomas.melin@...sala.com>,
        devicetree <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V1 2/6] iio: accel: sca3300: Add interface for operation modes.

On Mon, Jan 24, 2022 at 11:39 AM LI Qingwu
<Qing-wu.Li@...ca-geosystems.com.cn> wrote:
>
> The acceleration scale and the frequency were set via operation modes,
> the scal and frequency are both non-uniqueness,

scale

> this leads to logic confusion for setting scale.and.frequency.
> it getting worse if add more different sensor types into the driver.

It gets
if you add

> The commit add an interface for set and get the operation modes.
> the following interfaces added:

> in_accel_op_mode_available
> in_op_mode

Please indent them by let's say 2 spaces.

> SCA3300 operation modes table:
> | Mode | Full-scale | low pass filter frequency |
> | ---- | ---------- | ------------------------- |
> | 1    | ± 3 g      | 70 Hz                     |
> | 2    | ± 6 g      | 70 Hz                     |
> | 3    | ± 1.5 g    | 70 Hz                     |
> | 4    | ± 1.5 g    | 10 Hz                     |

...

> +static const char * const sca3300_op_modes[] = {
> +       [OP_MOD_1] = "1",
> +       [OP_MOD_2] = "2",
> +       [OP_MOD_3] = "3",

> +       [OP_MOD_4] = "4"

+ Comma.

> +};

...

> +       int mode;
> +       int ret;
> +       struct sca3300_data *data = iio_priv(indio_dev);

Here and everywhere else, can we keep reversed xmas tree order?

       struct sca3300_data *data = iio_priv(indio_dev);
      int mode;
       int ret;

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ