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: <CAHp75Vc_AnwjY6E_iE5RMOSh4eV2iWuqqAoteo9TvtgDT_CXKQ@mail.gmail.com>
Date: Fri, 25 Apr 2025 07:28:57 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Gustavo Silva <gustavograzs@...il.com>
Cc: Alex Lanzano <lanzano.alex@...il.com>, Jonathan Cameron <jic23@...nel.org>, 
	David Lechner <dlechner@...libre.com>, Nuno Sá <nuno.sa@...log.com>, 
	Andy Shevchenko <andy@...nel.org>, linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] iio: imu: bmi270: add channel for step counter

On Fri, Apr 25, 2025 at 3:15 AM Gustavo Silva <gustavograzs@...il.com> wrote:
>
> Add a channel for enabling/disabling the step counter, reading the
> number of steps and resetting the counter.

Looks ideal from the style and maintaining perspective, thanks for
making the reviewer's job easy! One small comment, but
Reviewed-by: Andy Shevchenko <andy@...nel.org>

...

> +       case IIO_CHAN_INFO_PROCESSED: {
> +               guard(mutex)(&data->mutex);

> +               if (val || !data->steps_enabled)
> +                       return -EINVAL;

Please, move the val check outside of the lock, no need to lock for
the local data.

> +               /* Clear step counter value */
> +               return bmi270_update_feature_reg(data, BMI270_SC_26_REG,
> +                                                BMI270_STEP_SC26_RST_CNT_MSK,
> +                                                FIELD_PREP(BMI270_STEP_SC26_RST_CNT_MSK,
> +                                                           1));
> +       }

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ