linux/drivers
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
..
accessibility
acpi Merge branches 'acpi-battery' and 'pm-cpufreq' 2014-01-06 22:49:08 +01:00
amba
ata Merge branch 'for-3.13-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata 2014-01-09 09:08:23 +08:00
atm
auxdisplay
base
bcma Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem 2014-01-10 10:59:40 -05:00
block block: null_blk: fix queue leak inside removing device 2014-01-12 16:22:42 +07:00
bluetooth Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next 2014-01-08 13:44:29 -05:00
bus
cdrom
char
clk clk: clk-divider: fix divisor > 255 bug 2014-01-08 08:33:12 -08:00
clocksource
connector
cpufreq intel_pstate: Add X86_FEATURE_APERFMPERF to cpu match parameters. 2014-01-06 22:16:14 +01:00
cpuidle
crypto
dca
devfreq
dio
dma
edac
eisa
extcon
firewire
firmware
fmc
gpio
gpu Merge branch 'drm-nouveau-next' of git://git.freedesktop.org/git/nouveau/linux-2.6 into drm-fixes 2014-01-15 15:01:11 +10:00
hid
hsi
hv
hwmon hwmon: (coretemp) Fix truncated name of alarm attributes 2014-01-14 09:47:52 -08:00
hwspinlock
i2c
ide
idle intel_idle: close avn_cstates array with correct marker 2014-01-10 03:06:06 +01:00
iio
infiniband net: replace macros net_random and net_srandom with direct calls to prandom 2014-01-14 15:15:25 -08:00
input
iommu
ipack
irqchip
isdn net: add build-time checks for msg->msg_name size 2014-01-18 23:04:16 -08:00
leds leds: lp5521/5523: Remove duplicate mutex 2014-01-10 14:48:07 -08:00
lguest
macintosh
mailbox
md md: half a dozen bug fixes for 3.13 2014-01-15 15:07:36 +07:00
media
memory
memstick
message
mfd This is the 2nd MFD pull request for 3.13 2014-01-11 06:23:57 +07:00
misc
mmc mmc: omap: Fix I2C dependency and make driver usable with device tree 2013-11-26 15:51:16 -08:00
mtd
net random32: add prandom_u32_max and convert open coded users 2014-01-21 23:17:20 -08:00
nfc NFC: nfcmrvl: Fix possible memory leak issue 2014-01-09 01:27:20 +01:00
ntb
nubus
of phylib: Add of_phy_attach 2014-01-13 14:29:49 -08:00
oprofile
parisc
parport
pci
pcmcia
phy phy,exynos: Add dependency on HAS_IOMEM 2014-01-15 14:51:22 -08:00
pinctrl
platform
pnp
power power,goldfish: Add dependency on HAS_IOMEM 2014-01-15 14:51:22 -08:00
powercap
pps
ps3
ptp ptp_pch: Add dependency on HAS_IOMEM 2014-01-15 14:51:22 -08:00
pwm
rapidio
regulator
remoteproc
reset
rpmsg
rtc
s390 qeth: bridgeport support - address notifications 2014-01-15 14:48:01 -08:00
sbus
scsi
sfi
sh
sn
spi
ssb
staging Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem 2014-01-17 14:43:17 -05:00
target
tc
thermal
tty
uio
usb
uwb
vfio
vhost
video
virt
virtio
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile