Re: [PATCH v1 3/6] media: dvb-frontends: atbm8830: Convert to use PI definition

Hans Verkuil
2025-10-30T07:27:00Z

On 27/10/2025 15:34, Andy Shevchenko wrote:
> Convert to use PI definition instead of open coded value of it.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Acked-by: Hans Verkuil <hverkuil+cisco@kernel.org>

Feel free to merge this through a non-media subsystem. If you want me to
take this as a separate media subsystem patch once units.h is patched,
then let me know.

Regards,

Hans

> ---
> drivers/media/dvb-frontends/atbm8830.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/dvb-frontends/atbm8830.c b/drivers/media/dvb-frontends/atbm8830.c
> index 778c865085bf..74032364d183 100644
> --- a/drivers/media/dvb-frontends/atbm8830.c
> +++ b/drivers/media/dvb-frontends/atbm8830.c
> @@ -6,7 +6,8 @@
> * Copyright (C) 2009 David T.L. Wong <davidtlwong@gmail.com>
> */
>
> -#include <asm/div64.h>
> +#include <linux/math64.h>
> +#include <linux/units.h>
> #include <media/dvb_frontend.h>
>
> #include "atbm8830.h"
> @@ -112,7 +113,7 @@ static int set_if_freq(struct atbm_state *priv, u32 freq /*in kHz*/)
>
> if (freq != 0) {
> /* 2 * PI * (freq - fs) / fs * (2 ^ 22) */
> - t = (u64) 2 * 31416 * (freq - fs);
> + t = 2 * DIV_ROUND_UP_ULL(PI, 100000) * (freq - fs);
> t <<= 22;
> do_div(t, fs);
> do_div(t, 1000);