summaryrefslogtreecommitdiffstats
path: root/kernel/torture.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2023-07-12 14:56:51 -0700
committerPaul E. McKenney <paulmck@kernel.org>2023-08-14 15:01:08 -0700
commit6cab60ceb1d32b795ae22fea5719fb6150e4cda9 (patch)
tree8aa6e0ba2a01ed1ad6d9e73ebbc6dbfd8faeb249 /kernel/torture.c
parent10af43671e8bf4ac153c4991a17cdf57bc6d2cfe (diff)
downloadlinux-6cab60ceb1d32b795ae22fea5719fb6150e4cda9.tar.gz
linux-6cab60ceb1d32b795ae22fea5719fb6150e4cda9.tar.bz2
linux-6cab60ceb1d32b795ae22fea5719fb6150e4cda9.zip
torture: Stop right-shifting torture_random() return values
Now that torture_random() uses swahw32(), its callers no longer see not-so-random low-order bits, as these are now swapped up into the upper 16 bits of the torture_random() function's return value. This commit therefore removes the right-shifting of torture_random() return values. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/torture.c')
-rw-r--r--kernel/torture.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/torture.c b/kernel/torture.c
index 984651de4b55..b28b05bbef02 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -92,7 +92,7 @@ int torture_hrtimeout_ns(ktime_t baset_ns, u32 fuzzt_ns, struct torture_random_s
ktime_t hto = baset_ns;
if (trsp)
- hto += (torture_random(trsp) >> 3) % fuzzt_ns;
+ hto += torture_random(trsp) % fuzzt_ns;
set_current_state(TASK_IDLE);
return schedule_hrtimeout(&hto, HRTIMER_MODE_REL);
}
@@ -362,7 +362,7 @@ torture_onoff(void *arg)
torture_hrtimeout_jiffies(HZ / 10, &rand);
continue;
}
- cpu = (torture_random(&rand) >> 4) % (maxcpu + 1);
+ cpu = torture_random(&rand) % (maxcpu + 1);
if (!torture_offline(cpu,
&n_offline_attempts, &n_offline_successes,
&sum_offline, &min_offline, &max_offline))