[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b573d80c-bd93-4592-86b4-e6c398d5862e@kernel.org>
Date: Thu, 30 Oct 2025 08:24:59 +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 1/6] media: vidtv: Rename PI definition to PI_SAMPLES
On 27/10/2025 15:34, Andy Shevchenko wrote:
> The definition of PI in the driver is not the actual value in radians,
> but rather degrees. Since we are going to have a value in radians
> defined in a global header, rename this definition to avoid potential
> collisions. No functional changes.
> 
> 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, then let me know.
Regards,
	Hans
> ---
>  drivers/media/test-drivers/vidtv/vidtv_s302m.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/test-drivers/vidtv/vidtv_s302m.c b/drivers/media/test-drivers/vidtv/vidtv_s302m.c
> index 9da18eac04b5..b3217d643b1e 100644
> --- a/drivers/media/test-drivers/vidtv/vidtv_s302m.c
> +++ b/drivers/media/test-drivers/vidtv/vidtv_s302m.c
> @@ -45,7 +45,7 @@
>  #define FF_S302M_DEFAULT_PTS_OFFSET 100000
>  
>  /* Used by the tone generator: number of samples for PI */
> -#define PI		180
> +#define PI_SAMPLES		180
>  
>  static const u8 reverse[256] = {
>  	/* from ffmpeg */
> @@ -259,10 +259,10 @@ static u16 vidtv_s302m_get_sample(struct vidtv_encoder *e)
>  		if (!ctx->last_tone)
>  			return 0x8000;
>  
> -		pos = (2 * PI * ctx->note_offset * ctx->last_tone) / S302M_SAMPLING_RATE_HZ;
> +		pos = (2 * PI_SAMPLES * ctx->note_offset * ctx->last_tone) / S302M_SAMPLING_RATE_HZ;
>  		ctx->note_offset++;
>  
> -		return (fixp_sin32(pos % (2 * PI)) >> 16) + 0x8000;
> +		return (fixp_sin32(pos % (2 * PI_SAMPLES)) >> 16) + 0x8000;
>  	}
>  
>  	/* bug somewhere */
Powered by blists - more mailing lists
 
