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] [day] [month] [year] [list]
Message-ID: <CAHp75VfAe2=ok4U07M27B_b=BxGMcNPT=upCmv7WfNFdxTVt0Q@mail.gmail.com>
Date: Sun, 14 Sep 2025 14:40:46 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Gustavo Silva <gustavograzs@...il.com>
Cc: lanzano.alex@...il.com, jic23@...nel.org, dlechner@...libre.com, 
	nuno.sa@...log.com, andy@...nel.org, linux-iio@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 3/4] iio: imu: bmi270: add support for motion events

On Sat, Sep 13, 2025 at 3:45 PM Gustavo Silva <gustavograzs@...il.com> wrote:
> On Sat, Aug 30, 2025 at 03:44:37PM +0300, Andy Shevchenko wrote:
>
> > > +#define BMI270_INT_MICRO_TO_RAW(val, val2, scale) \
> > > +       ((val) * (scale) + ((val2) * (scale)) / MEGA)
> > > +#define BMI270_RAW_TO_MICRO(raw, scale) \
> > > +       ((((raw) % (scale)) * MEGA) / scale)
> >
> > In the macro names "MICRO" in the implementation "MEGA", please make
> > this consistent.
> >
> These macros are intended to work with values of type
> IIO_VAL_INT_PLUS_MICRO. The division by MEGA is what produces the
> fractional part in micro, so the naming was chosen to reflect the
> result.
> If you prefer, I can rename them for clarity. But please note that the
> same naming is already used in the BMI323 driver, and I kept it
> consistent here.

Ah, okay, this makes sense. So, if we ever want to switch it's better
to do it with both (or more?) drivers.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ