[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251027143850.2070427-4-andriy.shevchenko@linux.intel.com>
Date: Mon, 27 Oct 2025 15:34:52 +0100
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
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: [PATCH v1 3/6] media: dvb-frontends: atbm8830: Convert to use PI definition
Convert to use PI definition instead of open coded value of it.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
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);
--
2.50.1
Powered by blists - more mailing lists