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

Andy Shevchenko
2025-10-27T14:39:00Z

Convert to use PI definition instead of open coded value of it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.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@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);
--
2.50.1