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

cacheinfo: Don't opencode per_cpu_cacheinfo()

That file contains a local helper that returns ->info_list, just use it.
No functional changes.

Signed-off-by: Nikolay Borisov <nik.borisov@suse.com>
Link: https://lore.kernel.org/r/20241023051118.888065-1-nik.borisov@suse.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Nikolay Borisov and committed by
Greg Kroah-Hartman
f87f132c 81089c89

+2 -7
+2 -7
drivers/base/cacheinfo.c
··· 367 367 368 368 cpumask_set_cpu(cpu, &this_leaf->shared_cpu_map); 369 369 for_each_online_cpu(i) { 370 - struct cpu_cacheinfo *sib_cpu_ci = get_cpu_cacheinfo(i); 371 - 372 - if (i == cpu || !sib_cpu_ci->info_list) 370 + if (i == cpu || !per_cpu_cacheinfo(i)) 373 371 continue;/* skip if itself or no cacheinfo */ 374 372 for (sib_index = 0; sib_index < cache_leaves(i); sib_index++) { 375 373 sib_leaf = per_cpu_cacheinfo_idx(i, sib_index); ··· 407 409 for (index = 0; index < cache_leaves(cpu); index++) { 408 410 this_leaf = per_cpu_cacheinfo_idx(cpu, index); 409 411 for_each_cpu(sibling, &this_leaf->shared_cpu_map) { 410 - struct cpu_cacheinfo *sib_cpu_ci = 411 - get_cpu_cacheinfo(sibling); 412 - 413 - if (sibling == cpu || !sib_cpu_ci->info_list) 412 + if (sibling == cpu || !per_cpu_cacheinfo(sibling)) 414 413 continue;/* skip if itself or no cacheinfo */ 415 414 416 415 for (sib_index = 0; sib_index < cache_leaves(sibling); sib_index++) {