Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: vivid: use prandom

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>

authored by

Markus Theil and committed by
Jason A. Donenfeld
8c0cf654 a6a4d97f

+3 -1
+3 -1
drivers/media/test-drivers/vivid/vivid-vid-cap.c
··· 302 302 */ 303 303 freq_modulus = (dev->tv_freq - 676 /* (43.25-1) * 16 */) % (6 * 16); 304 304 if (freq_modulus > 2 * 16) { 305 + struct rnd_state prng; 306 + prandom_seed_state(&prng, dev->tv_freq ^ 0x55); 305 307 tpg_s_quality(&dev->tpg, TPG_QUAL_NOISE, 306 - next_pseudo_random32(dev->tv_freq ^ 0x55) & 0x3f); 308 + prandom_u32_state(&prng) & 0x3f); 307 309 return; 308 310 } 309 311 if (freq_modulus < 12 /*0.75 * 16*/ || freq_modulus > 20 /*1.25 * 16*/)