Daniel Borkmann wrote: > On 06/08/2014 07:34 PM, Hannes Frederic Sowa wrote: >> Please check this as it makes the code more complicated and I doubt it is >> worth it. > > Agreed.
Just to clarify, the goal is to be able to replace "prandom_u32() % range" all over the kernel with "prandom_u32_max(range)" and promise people that it's guaranteed to be just as good. My goal is a one-time cleanup to eliminate "prandom_u32() % range" so people will stop cutting and pasting it into new code. (FIXME: Add a kdoc update on the subject.) It uglifies the random32 code for sure, but by encapsulating the cleverness it lets all the call sites be simpler and reduces arguments about the change. E.g. have a look at all the prandom_u32 calls in net/core/pktgen.c. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/