Re: [PATCH v1 2/6] units: Add value of π * 10⁹

Jonathan Cameron
2025-10-27T14:52:21Z

On Mon, 27 Oct 2025 15:34:51 +0100
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> There are a few drivers that want to have this value, and at least one
> known to come soon. Let's define a value for them.

Is there any way we can make the x10^9 bit obvious in the naming? Or do
something a bit nasty like defining a macro along the lines of

PI(scale)?
e.g. PI(NANO), PI(10000)

>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> include/linux/units.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/include/linux/units.h b/include/linux/units.h
> index f626e212d4ca..82bdc2041328 100644
> --- a/include/linux/units.h
> +++ b/include/linux/units.h
> @@ -21,6 +21,9 @@
> #define PICO 1000000000000ULL
> #define FEMTO 1000000000000000ULL
>
> +/* Value of π * 10⁹ */
> +#define PI 3141592653LL
> +
> /* Hz based multipliers */
> #define NANOHZ_PER_HZ 1000000000UL
> #define MICROHZ_PER_HZ 1000000UL