Skip to content

Commit

Permalink
powerpc/pseries: rename numa_dist_table to form2_distances
Browse files Browse the repository at this point in the history
The name of the local variable holding the "form2" property address
conflicts with the numa_distance_table global.

This patch does 's/numa_dist_table/form2_distances/g' over the function,
which also renames numa_dist_table_length to form2_distances_length.

Suggested-by: Michael Ellerman <[email protected]>
Signed-off-by: Nicholas Piggin <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
npiggin authored and mpe committed Nov 15, 2021
1 parent 964c33c commit 0bd8127
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions arch/powerpc/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ static void initialize_form2_numa_distance_lookup_table(void)
{
int i, j;
struct device_node *root;
const __u8 *numa_dist_table;
const __u8 *form2_distances;
const __be32 *numa_lookup_index;
int numa_dist_table_length;
int form2_distances_length;
int max_numa_index, distance_index;

if (firmware_has_feature(FW_FEATURE_OPAL))
Expand All @@ -392,20 +392,20 @@ static void initialize_form2_numa_distance_lookup_table(void)
max_numa_index = of_read_number(&numa_lookup_index[0], 1);

/* first element of the array is the size and is encode-int */
numa_dist_table = of_get_property(root, "ibm,numa-distance-table", NULL);
numa_dist_table_length = of_read_number((const __be32 *)&numa_dist_table[0], 1);
form2_distances = of_get_property(root, "ibm,numa-distance-table", NULL);
form2_distances_length = of_read_number((const __be32 *)&form2_distances[0], 1);
/* Skip the size which is encoded int */
numa_dist_table += sizeof(__be32);
form2_distances += sizeof(__be32);

pr_debug("numa_dist_table_len = %d, numa_dist_indexes_len = %d\n",
numa_dist_table_length, max_numa_index);
pr_debug("form2_distances_len = %d, numa_dist_indexes_len = %d\n",
form2_distances_length, max_numa_index);

for (i = 0; i < max_numa_index; i++)
/* +1 skip the max_numa_index in the property */
numa_id_index_table[i] = of_read_number(&numa_lookup_index[i + 1], 1);


if (numa_dist_table_length != max_numa_index * max_numa_index) {
if (form2_distances_length != max_numa_index * max_numa_index) {
WARN(1, "Wrong NUMA distance information\n");
/* consider everybody else just remote. */
for (i = 0; i < max_numa_index; i++) {
Expand All @@ -427,7 +427,7 @@ static void initialize_form2_numa_distance_lookup_table(void)
int nodeA = numa_id_index_table[i];
int nodeB = numa_id_index_table[j];

numa_distance_table[nodeA][nodeB] = numa_dist_table[distance_index++];
numa_distance_table[nodeA][nodeB] = form2_distances[distance_index++];
pr_debug("dist[%d][%d]=%d ", nodeA, nodeB, numa_distance_table[nodeA][nodeB]);
}
}
Expand Down

0 comments on commit 0bd8127

Please sign in to comment.