From: Hans Verkuil <hverkuil+cisco@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-iio@vger.kernel.org, chrome-platform@lists.linux.dev,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Benson Leung" <bleung@chromium.org>,
"Guenter Roeck" <groeck@chromium.org>,
"Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Daniel W. S. Almeida" <dwlsalmeida@gmail.com>
Subject: Re: [PATCH v1 3/6] media: dvb-frontends: atbm8830: Convert to use PI definition
Date: Thu, 30 Oct 2025 08:26:55 +0100 [thread overview]
Message-ID: <4c114b45-e4b9-4a68-8391-bad00c8b3a25@kernel.org> (raw)
In-Reply-To: <20251027143850.2070427-4-andriy.shevchenko@linux.intel.com>
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);
next prev parent reply other threads:[~2025-10-30 7:27 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-27 14:34 [PATCH v1 0/6] iio: Introduce and use value of π Andy Shevchenko
2025-10-27 14:34 ` [PATCH v1 1/6] media: vidtv: Rename PI definition to PI_SAMPLES Andy Shevchenko
2025-10-30 7:24 ` Hans Verkuil
2025-10-27 14:34 ` [PATCH v1 2/6] units: Add value of π * 10⁹ Andy Shevchenko
2025-10-27 14:52 ` Jonathan Cameron
2025-10-27 14:59 ` David Lechner
2025-10-28 8:09 ` Andy Shevchenko
2025-10-27 19:30 ` David Laight
2025-10-28 8:08 ` Andy Shevchenko
2025-10-28 9:27 ` David Laight
2025-10-27 14:34 ` [PATCH v1 3/6] media: dvb-frontends: atbm8830: Convert to use PI definition Andy Shevchenko
2025-10-30 7:26 ` Hans Verkuil [this message]
2025-10-27 14:34 ` [PATCH v1 4/6] iio: cros_ec_sensors: " Andy Shevchenko
2025-10-27 14:34 ` [PATCH v1 5/6] iio: frequency: ad9523: " Andy Shevchenko
2025-10-27 14:34 ` [PATCH v1 6/6] iio: position: iqs624-pos: " Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4c114b45-e4b9-4a68-8391-bad00c8b3a25@kernel.org \
--to=hverkuil+cisco@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=andy@kernel.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=dlechner@baylibre.com \
--cc=dwlsalmeida@gmail.com \
--cc=groeck@chromium.org \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox