linux/include
Daniel Borkmann f337db64af random32: add prandom_u32_max and convert open coded users
Many functions have open coded a function that returns a random
number in range [0,N-1]. Under the assumption that we have a PRNG
such as taus113 with being well distributed in [0, ~0U] space,
we can implement such a function as uword t = (n*m')>>32, where
m' is a random number obtained from PRNG, n the right open interval
border and t our resulting random number, with n,m',t in u32 universe.

Lets go with Joe and simply call it prandom_u32_max(), although
technically we have an right open interval endpoint, but that we
have documented. Other users can further be migrated to the new
prandom_u32_max() function later on; for now, we need to make sure
to migrate reciprocal_divide() users for the reciprocal_divide()
follow-up fixup since their function signatures are going to change.

Joint work with Hannes Frederic Sowa.

Cc: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-01-21 23:17:20 -08:00
..
acpi Merge branches 'acpi-pci-pm' and 'acpi-pci-hotplug' 2013-12-31 22:03:37 +01:00
asm-generic Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-01-06 17:37:45 -05:00
clocksource drivers: clocksource: add support for ARM architected timer event stream 2013-09-26 09:48:00 +01:00
crypto crypto: scatterwalk - Use sg_chain_ptr on chain entries 2013-12-09 19:58:52 +08:00
drm drm/radeon: 0x9649 is SUMO2 not SUMO 2013-12-23 10:03:41 -05:00
dt-bindings For the 3.13 merge window we have a couple of new drivers for the AMS 2013-11-15 16:37:40 -08:00
keys KEYS: Separate the kernel signature checking keyring from module signing 2013-09-25 17:17:01 +01:00
kvm ARM: KVM: vgic: Bump VGIC_NR_IRQS to 256 2013-08-30 16:12:39 +03:00
linux random32: add prandom_u32_max and convert open coded users 2014-01-21 23:17:20 -08:00
math-emu
media [media] videobuf2: Add support for file access mode flags for DMABUF exporting 2013-12-09 14:50:50 -02:00
memory
misc
net sctp: remove macros sctp_bh_[un]lock_sock 2014-01-21 18:41:36 -08:00
pcmcia
ras
rdma IB/core: const'ify inbuf in struct ib_udata 2013-12-16 10:38:28 -08:00
rxrpc
scsi [SCSI] Disable WRITE SAME for RAID and virtual host adapter drivers 2013-11-29 08:48:39 +04:00
sound ALSA: memalloc.h - fix wrong truncation of dma_addr_t 2013-12-10 15:30:46 +01:00
target target/file: Update hw_max_sectors based on current block_size 2013-12-19 00:18:54 -08:00
trace net: Add trace events for all receive entry points, exposing more skb fields 2014-01-14 14:46:02 -08:00
uapi ipv6: add a flag to get the flow label used remotly 2014-01-19 17:12:31 -08:00
video fbdev changes for 3.13 2013-11-14 14:44:20 +09:00
xen Bug-fixes: 2013-12-20 09:34:54 -08:00
Kbuild