iommu/arm-smmu: remove redundant assignment to variable res
Subsystems (3)
PATCH 1/1 iommu/arm-smmu: remove redundant assignment to variable res
The variable res is being assigned a value that isn't being read later. The assignment is redundant and can be removed.
Cleans up clang scan warning:drivers/iommu/arm/arm-smmu/arm-smmu.c:2109:10: warning: Although the value stored to 'res' is used in the enclosing expression, the value is never actually read from 'res' [deadcode.DeadStores]
--- drivers/iommu/arm/arm-smmu/arm-smmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/arm/arm-smmu/arm-smmu.c +1 -1
@@ -2106,7 +2106,7 @@ static int arm_smmu_device_probe(struct platform_device *pdev)return PTR_ERR (smmu); num_irqs =0 ; -while ((res =platform_get_resource (pdev,IORESOURCE_IRQ , num_irqs))) { +while (platform_get_resource (pdev,IORESOURCE_IRQ , num_irqs)) { num_irqs++;if (num_irqs > smmu->num_global_irqs) smmu->num_context_irqs++;
Signature · 1 line
2.34.1
Robin Murphy
reviewerQuoted 7 lines · Colin Ian King
The variable res is being assigned a value that isn't being read later. The assignment is redundant and can be removed.
Cleans up clang scan warning:
drivers/iommu/arm/arm-smmu/arm-smmu.c:2109:10: warning: Although the value stored to 'res' is used in the enclosing expression, the value is never actually read from 'res' [deadcode.DeadStores]
Thanks Colin, however in general we need to get rid of this platform_get_resource() call ASAP anyway, so Will should hopefully be picking up either [1] or [2] for 5.18.
Cheers,
Robin.
[1] https://lore.kernel.org/linux-arm-kernel/b2a40caaf1622eb35c555074a0d72f4f0513cff9.1645106346.git.robin.murphy@arm.com/
[2] https://lore.kernel.org/linux-arm-kernel/[email protected]/
Quoted 10 lines
Signed-off-by Colin Ian King <[email protected]>--- drivers/iommu/arm/arm-smmu/arm-smmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iommu/arm/arm-smmu/arm-smmu.c +0
-0
drivers/iommu/arm/arm-smmu/arm-smmu.c static int arm_smmu_device_probe(struct platform_device *pdev) · line 2112
Quoted 8 lines
drivers/iommu/arm/arm-smmu/arm-smmu.c +1
-1@@ -2106,7 +2106,7 @@ static int arm_smmu_device_probe(struct platform_device *pdev)return PTR_ERR (smmu); num_irqs =0 ; -while ((res =platform_get_resource (pdev,IORESOURCE_IRQ , num_irqs))) { +while (platform_get_resource (pdev,IORESOURCE_IRQ , num_irqs)) { num_irqs++;if (num_irqs > smmu->num_global_irqs) smmu->num_context_irqs++;
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu