Skip to content

Commit f87f132

Browse files
Nikolay Borisovgregkh
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 81089c8 commit f87f132

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

drivers/base/cacheinfo.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,7 @@ static int cache_shared_cpu_map_setup(unsigned int cpu)
367367

368368
cpumask_set_cpu(cpu, &this_leaf->shared_cpu_map);
369369
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))
373371
continue;/* skip if itself or no cacheinfo */
374372
for (sib_index = 0; sib_index < cache_leaves(i); sib_index++) {
375373
sib_leaf = per_cpu_cacheinfo_idx(i, sib_index);
@@ -409,10 +407,7 @@ static void cache_shared_cpu_map_remove(unsigned int cpu)
409407
for (index = 0; index < cache_leaves(cpu); index++) {
410408
this_leaf = per_cpu_cacheinfo_idx(cpu, index);
411409
for_each_cpu(sibling, &this_leaf->shared_cpu_map) {
412-
struct cpu_cacheinfo *sib_cpu_ci =
413-
get_cpu_cacheinfo(sibling);
414-
415-
if (sibling == cpu || !sib_cpu_ci->info_list)
410+
if (sibling == cpu || !per_cpu_cacheinfo(sibling))
416411
continue;/* skip if itself or no cacheinfo */
417412

418413
for (sib_index = 0; sib_index < cache_leaves(sibling); sib_index++) {

0 commit comments

Comments
 (0)