]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: vivid: use prandom
authorMarkus Theil <theil.markus@gmail.com>
Tue, 11 Feb 2025 06:33:31 +0000 (07:33 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Thu, 30 Oct 2025 17:35:26 +0000 (18:35 +0100)
This is part of a prandom cleanup, which removes
next_pseudo_random32 and replaces it with the standard PRNG.

Signed-off-by: Markus Theil <theil.markus@gmail.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/media/test-drivers/vivid/vivid-vid-cap.c

index 8b3162e8203271e7708b4b8a7389da9873aff40c..b95f06a9b5ae91408e161c505159707a4c5e7eae 100644 (file)
@@ -302,8 +302,10 @@ void vivid_update_quality(struct vivid_dev *dev)
         */
        freq_modulus = (dev->tv_freq - 676 /* (43.25-1) * 16 */) % (6 * 16);
        if (freq_modulus > 2 * 16) {
+               struct rnd_state prng;
+               prandom_seed_state(&prng, dev->tv_freq ^ 0x55);
                tpg_s_quality(&dev->tpg, TPG_QUAL_NOISE,
-                       next_pseudo_random32(dev->tv_freq ^ 0x55) & 0x3f);
+                       prandom_u32_state(&prng) & 0x3f);
                return;
        }
        if (freq_modulus < 12 /*0.75 * 16*/ || freq_modulus > 20 /*1.25 * 16*/)