[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4c114b45-e4b9-4a68-8391-bad00c8b3a25@kernel.org>
Date: Thu, 30 Oct 2025 08:26:55 +0100
From: Hans Verkuil <hverkuil+cisco@...nel.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
 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>, David Lechner
 <dlechner@...libre.com>, 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 v1 3/6] media: dvb-frontends: atbm8830: Convert to use PI
 definition
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@...ux.intel.com>
Acked-by: Hans Verkuil <hverkuil+cisco@...nel.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@...il.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);
Powered by blists - more mailing lists
 
