linux/include
Matthew Wilcox e096f6a762 idr: Add idr_alloc_u32 helper
All current users of idr_alloc_ext() actually want to allocate a u32
and idr_alloc_u32() fits their needs better.

Like idr_get_next(), it uses a 'nextid' argument which serves as both
a pointer to the start ID and the assigned ID (instead of a separate
minimum and pointer-to-assigned-ID argument).  It uses a 'max' argument
rather than 'end' because the semantics that idr_alloc has for 'end'
don't work well for unsigned types.

Since idr_alloc_u32() returns an errno instead of the allocated ID, mark
it as __must_check to help callers use it correctly.  Include copious
kernel-doc.  Chris Mi <chrism@mellanox.com> has promised to contribute
test-cases for idr_alloc_u32.

Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
2018-02-06 16:40:32 -05:00
..
acpi
asm-generic The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
clocksource
crypto
drm drm/graphics pull request for v4.16-rc1 2018-02-01 17:48:47 -08:00
dt-bindings This is the bulk of pin control changes for the v4.16 kernel cycle: 2018-02-02 14:22:53 -08:00
keys
kvm
linux idr: Add idr_alloc_u32 helper 2018-02-06 16:40:32 -05:00
math-emu
media
memory
misc powerpc updates for 4.16 2018-02-02 10:01:04 -08:00
net Currently, hardened usercopy performs dynamic bounds checking on slab 2018-02-03 16:25:42 -08:00
pcmcia
ras
rdma
scsi SCSI postmerge on 20180202 2018-02-03 13:07:56 -08:00
soc ARM: SoC driver updates for 4.16 2018-02-01 16:35:31 -08:00
sound
target
trace Char/Misc driver patches for 4.16-rc1 2018-02-01 10:31:17 -08:00
uapi Merge branch 'i2c/for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2018-02-04 10:57:43 -08:00
video
xen