Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

events: convert to idr_alloc()

Convert to the much saner new idr interface.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Tejun Heo and committed by
Linus Torvalds
0e9c3be2 d228d9ec

+3 -7
+3 -7
kernel/events/core.c
··· 5965 5965 pmu->name = name; 5966 5966 5967 5967 if (type < 0) { 5968 - int err = idr_pre_get(&pmu_idr, GFP_KERNEL); 5969 - if (!err) 5970 - goto free_pdc; 5971 - 5972 - err = idr_get_new_above(&pmu_idr, pmu, PERF_TYPE_MAX, &type); 5973 - if (err) { 5974 - ret = err; 5968 + type = idr_alloc(&pmu_idr, pmu, PERF_TYPE_MAX, 0, GFP_KERNEL); 5969 + if (type < 0) { 5970 + ret = type; 5975 5971 goto free_pdc; 5976 5972 } 5977 5973 }