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

drivers/perf:Directly use ida_alloc()/free()

Use ida_alloc()/ida_free() instead of deprecated
ida_simple_get()/ida_simple_remove() .

Signed-off-by: keliu <liuke94@huawei.com>
Link: https://lore.kernel.org/r/20220519080127.147030-2-liuke94@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>

authored by

keliu and committed by
Will Deacon
a336916b 49785a77

+3 -3
+3 -3
drivers/perf/arm-ccn.c
··· 1250 1250 ccn->dt.cmp_mask[CCN_IDX_MASK_OPCODE].h = ~(0x1f << 9); 1251 1251 1252 1252 /* Get a convenient /sys/event_source/devices/ name */ 1253 - ccn->dt.id = ida_simple_get(&arm_ccn_pmu_ida, 0, 0, GFP_KERNEL); 1253 + ccn->dt.id = ida_alloc(&arm_ccn_pmu_ida, GFP_KERNEL); 1254 1254 if (ccn->dt.id == 0) { 1255 1255 name = "ccn"; 1256 1256 } else { ··· 1312 1312 &ccn->dt.node); 1313 1313 error_set_affinity: 1314 1314 error_choose_name: 1315 - ida_simple_remove(&arm_ccn_pmu_ida, ccn->dt.id); 1315 + ida_free(&arm_ccn_pmu_ida, ccn->dt.id); 1316 1316 for (i = 0; i < ccn->num_xps; i++) 1317 1317 writel(0, ccn->xp[i].base + CCN_XP_DT_CONTROL); 1318 1318 writel(0, ccn->dt.base + CCN_DT_PMCR); ··· 1329 1329 writel(0, ccn->xp[i].base + CCN_XP_DT_CONTROL); 1330 1330 writel(0, ccn->dt.base + CCN_DT_PMCR); 1331 1331 perf_pmu_unregister(&ccn->dt.pmu); 1332 - ida_simple_remove(&arm_ccn_pmu_ida, ccn->dt.id); 1332 + ida_free(&arm_ccn_pmu_ida, ccn->dt.id); 1333 1333 } 1334 1334 1335 1335 static int arm_ccn_for_each_valid_region(struct arm_ccn *ccn,