Skip to content

Commit

Permalink
ACPI/IORT: Rename arm_smmu_v3_set_proximity() 'node' local variable
Browse files Browse the repository at this point in the history
Commit 36a2ba0 ("ACPI/IORT: Reject platform device creation on NUMA
node mapping failure") introduced a local variable 'node' in
arm_smmu_v3_set_proximity() that shadows the struct acpi_iort_node
pointer function parameter.

Execution was unaffected but it is prone to errors and can lead
to subtle bugs.

Rename the local variable to prevent any issue.

Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
Reported-by: Will Deacon <will@kernel.org>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Hanjun Guo <guohanjun@huawei.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Will Deacon <will@kernel.org>
  • Loading branch information
Lorenzo Pieralisi authored and Will Deacon committed Aug 5, 2019
1 parent b717480 commit 3e77eeb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/acpi/arm64/iort.c
Original file line number Diff line number Diff line change
Expand Up @@ -1256,12 +1256,12 @@ static int __init arm_smmu_v3_set_proximity(struct device *dev,

smmu = (struct acpi_iort_smmu_v3 *)node->node_data;
if (smmu->flags & ACPI_IORT_SMMU_V3_PXM_VALID) {
int node = acpi_map_pxm_to_node(smmu->pxm);
int dev_node = acpi_map_pxm_to_node(smmu->pxm);

if (node != NUMA_NO_NODE && !node_online(node))
if (dev_node != NUMA_NO_NODE && !node_online(dev_node))
return -EINVAL;

set_dev_node(dev, node);
set_dev_node(dev, dev_node);
pr_info("SMMU-v3[%llx] Mapped to Proximity domain %d\n",
smmu->base_address,
smmu->pxm);
Expand Down

0 comments on commit 3e77eeb

Please sign in to comment.