[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fb4aafc1-dbfb-4533-b368-5d26e24acdf1@baylibre.com>
Date: Fri, 7 Nov 2025 15:09:58 -0600
From: David Lechner <dlechner@...libre.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Hans Verkuil <hverkuil+cisco@...nel.org>, linux-iio@...r.kernel.org,
chrome-platform@...ts.linux.dev, linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org
Cc: Jonathan Cameron <jic23@...nel.org>, Nuno Sá
<nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>,
Benson Leung <bleung@...omium.org>, Guenter Roeck <groeck@...omium.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
"Daniel W. S. Almeida" <dwlsalmeida@...il.com>
Subject: Re: [PATCH v2 2/6] units: Add 32- and 64-bit signed values of π
On 11/7/25 2:03 PM, Andy Shevchenko wrote:
> There are a few drivers that want to have these values, and
> one more known to come soon. Let's define the values for them.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
> include/linux/units.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/include/linux/units.h b/include/linux/units.h
> index f626e212d4ca..5b3293bce04c 100644
> --- a/include/linux/units.h
> +++ b/include/linux/units.h
> @@ -21,6 +21,12 @@
> #define PICO 1000000000000ULL
> #define FEMTO 1000000000000000ULL
>
> +/* Value of π * 10⁸ (fits s32 or signed int) */
> +#define PI 314159265
It isn't clear to me at all in the other patches that e.g.
DIV_ROUND_UP(PI, 1000) would be π ✕ 10⁴ (rounded to nearest
integer, of course).
Calling these PI_E8 and PI_E18 or PI_x10_8 and PI_x10_18
would help to clear that up.
> +
> +/* Value of π * 10¹⁸ (fits s64 or signed long long) */
> +#define PI_LL 3141592653589793238LL
> +
> /* Hz based multipliers */
> #define NANOHZ_PER_HZ 1000000000UL
> #define MICROHZ_PER_HZ 1000000UL
Powered by blists - more mailing lists