Commit 8c0cf654 authored by Markus Theil's avatar Markus Theil Committed by Jason A. Donenfeld
Browse files

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: default avatarMarkus Theil <theil.markus@gmail.com>
Reviewed-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
parent a6a4d97f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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*/)