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: <CAHp75VeseZ2ChtbafmbgVavS4KvCvrQ4+XSRkeiJSyqr8__dSw@mail.gmail.com>
Date:   Wed, 4 May 2022 16:20:11 +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>,
        linux-iio <linux-iio@...r.kernel.org>,
        Rob Herring <robh@...nel.org>
Subject: Re: [PATCH V3 3/5] iio: accel: sca3300: modified to support multi chips

On Wed, May 4, 2022 at 3:36 PM LI Qingwu
<Qing-wu.Li@...ca-geosystems.com.cn> wrote:
>
> The drive support sca3300 only.

driver supports

> There are some other similar chips, for instance, SCL3300.
> Prepare the way for multiple chips and additional channels.
> Modify the driver to read the device id.
> Add the tables for the corresponding id to support multiple chips.
> Add prepares for the addition of extra channels.
> Add prepares for handling the operation modes for multiple chips.

It seems you need to work more on the commit messages in all patches.

...

> +struct sca3300_chip_info {
> +       const struct iio_chan_spec *channels;
> +       const int (*accel_scale_table)[2];
> +       const int *accel_scale_modes_map;
> +       const unsigned long *scan_masks;
> +       const int *avail_modes_table;
> +       const int *freq_modes_map;
> +       const int *freq_table;
> +       const u8 num_accel_scales;
> +       const u8 num_avail_modes;
> +       const u8 num_channels;
> +       const u8 num_freqs;
> +       const u8 chip_id;

Why do you have const qualifier on all members?  The last one is
understandable, but the rest, esp. pointers should be justified.

> +       const char *name;
> +};

...

> +static int sca3300_set_op_mode(struct sca3300_data *sca_data, int index)
> +{
> +       int mode;
> +
> +       if ((index < 0) || (index >= sca_data->chip->num_avail_modes))

Too many parentheses.

> +               return -EINVAL;
> +
> +       mode = sca_data->chip->avail_modes_table[index];
> +
> +       return sca3300_write_reg(sca_data, SCA3300_REG_MODE, mode);
> +}

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ