- if (td->o.use_os_rand) {
- r = os_random_long(&td->trim_state);
- val = (OS_RAND_MAX / 100ULL);
- } else {
- r = __rand(&td->__trim_state);
- val = (FRAND_MAX / 100ULL);
- }
+ frand_max = rand_max(&td->trim_state);
+ r = __rand(&td->trim_state);
+ val = (frand_max / 100ULL);