]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: vidtv: Rename PI definition to PI_SAMPLES
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 7 Nov 2025 20:02:59 +0000 (21:02 +0100)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Mon, 16 Mar 2026 10:51:55 +0000 (11:51 +0100)
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.

Acked-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/test-drivers/vidtv/vidtv_s302m.c

index 5814976449407f393ffcb166f3301638725f22e5..3c08e442b2d15b4d161158ea3961d233fc2d0b66 100644 (file)
@@ -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 */