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: <CAHp75VerL3x7L=AeLfnT6D01a=FyY3JE4vbwNFMaJz-v=f2k9w@mail.gmail.com>
Date:   Tue, 29 Sep 2020 16:08:03 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Alexandru Ardelean <alexandru.ardelean@...log.com>
Cc:     linux-iio <linux-iio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Jonathan Cameron <jic23@...nel.org>,
        Eugen Hristev <eugen.hristev@...rochip.com>,
        Nicolas Ferre <nicolas.ferre@...rochip.com>,
        Ludovic Desroches <ludovic.desroches@...rochip.com>,
        Benson Leung <bleung@...omium.org>,
        Enric Balletbo i Serra <enric.balletbo@...labora.com>,
        groeck@...omium.org,
        Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
        Gwendal Grignou <gwendal@...omium.org>
Subject: Re: [PATCH v3 7/9] iio: cros_ec: use devm_iio_triggered_buffer_setup_ext()

On Tue, Sep 29, 2020 at 3:55 PM Alexandru Ardelean
<alexandru.ardelean@...log.com> wrote:

> This change switches to the new devm_iio_triggered_buffer_setup_ext()
> function and removes the iio_buffer_set_attrs() call, for assigning the
> HW FIFO attributes to the buffer.

Sorry, you were too fast with the version, below one nit.

> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@...log.com>
> ---
>  .../common/cros_ec_sensors/cros_ec_sensors_core.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> index c62cacc04672..1eafcf04ad69 100644
> --- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> +++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
> @@ -353,19 +353,22 @@ int cros_ec_sensors_core_init(struct platform_device *pdev,
>                         if (ret)
>                                 return ret;
>                 } else {
> +                       const struct attribute **fifo_attrs;
> +
> +                       if (has_hw_fifo)
> +                               fifo_attrs = cros_ec_sensor_fifo_attributes;
> +                       else
> +                               fifo_attrs = NULL;
> +
>                         /*
>                          * The only way to get samples in buffer is to set a
>                          * software trigger (systrig, hrtimer).
>                          */
> -                       ret = devm_iio_triggered_buffer_setup(

> +                       ret = devm_iio_triggered_buffer_setup_ext(
>                                         dev, indio_dev, NULL, trigger_capture,
> -                                       NULL);
> +                                       NULL, fifo_attrs);

Perhaps it's time to reformat a bit, i.e. move dev to the first line
and do the rest accordingly?

>                         if (ret)
>                                 return ret;
> -
> -                       if (has_hw_fifo)
> -                               iio_buffer_set_attrs(indio_dev->buffer,
> -                                                    cros_ec_sensor_fifo_attributes);
>                 }
>         }
>
> --
> 2.17.1
>


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ