All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI/IORT: Rename arm_smmu_v3_set_proximity() 'node' local variable
@ 2019-07-22 16:14 ` Lorenzo Pieralisi
  0 siblings, 0 replies; 4+ messages in thread
From: Lorenzo Pieralisi @ 2019-07-22 16:14 UTC (permalink / raw)
  To: linux-acpi
  Cc: Lorenzo Pieralisi, Will Deacon, Hanjun Guo, Sudeep Holla,
	Catalin Marinas, Robin Murphy, Kefeng Wang, LKML, LAKML

Commit 36a2ba07757d ("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.

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>
---
 drivers/acpi/arm64/iort.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index d4551e33fa71..15dbfd657d82 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -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);
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] ACPI/IORT: Rename arm_smmu_v3_set_proximity() 'node' local variable
@ 2019-07-22 16:14 ` Lorenzo Pieralisi
  0 siblings, 0 replies; 4+ messages in thread
From: Lorenzo Pieralisi @ 2019-07-22 16:14 UTC (permalink / raw)
  To: linux-acpi
  Cc: Kefeng Wang, Lorenzo Pieralisi, Catalin Marinas, Hanjun Guo,
	Robin Murphy, LKML, Sudeep Holla, Will Deacon, LAKML

Commit 36a2ba07757d ("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.

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>
---
 drivers/acpi/arm64/iort.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index d4551e33fa71..15dbfd657d82 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -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);
-- 
2.21.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI/IORT: Rename arm_smmu_v3_set_proximity() 'node' local variable
  2019-07-22 16:14 ` Lorenzo Pieralisi
@ 2019-07-23  1:41   ` Hanjun Guo
  -1 siblings, 0 replies; 4+ messages in thread
From: Hanjun Guo @ 2019-07-23  1:41 UTC (permalink / raw)
  To: Lorenzo Pieralisi, linux-acpi
  Cc: Will Deacon, Sudeep Holla, Catalin Marinas, Robin Murphy,
	Kefeng Wang, LKML, LAKML

On 2019/7/23 0:14, Lorenzo Pieralisi wrote:
> Commit 36a2ba07757d ("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.
> 
> 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>
> ---
>  drivers/acpi/arm64/iort.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Hanjun Guo <guohanjun@huawei.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPI/IORT: Rename arm_smmu_v3_set_proximity() 'node' local variable
@ 2019-07-23  1:41   ` Hanjun Guo
  0 siblings, 0 replies; 4+ messages in thread
From: Hanjun Guo @ 2019-07-23  1:41 UTC (permalink / raw)
  To: Lorenzo Pieralisi, linux-acpi
  Cc: Kefeng Wang, Catalin Marinas, Robin Murphy, LKML, Sudeep Holla,
	Will Deacon, LAKML

On 2019/7/23 0:14, Lorenzo Pieralisi wrote:
> Commit 36a2ba07757d ("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.
> 
> 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>
> ---
>  drivers/acpi/arm64/iort.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Hanjun Guo <guohanjun@huawei.com>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-23  1:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22 16:14 [PATCH] ACPI/IORT: Rename arm_smmu_v3_set_proximity() 'node' local variable Lorenzo Pieralisi
2019-07-22 16:14 ` Lorenzo Pieralisi
2019-07-23  1:41 ` Hanjun Guo
2019-07-23  1:41   ` Hanjun Guo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.