* [PATCH] iommu/arm-smmu: remove redundant assignment to variable res
@ 2022-02-25 9:32 Colin Ian King
2022-02-25 14:32 ` Robin Murphy
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-02-25 9:32 UTC (permalink / raw)
To: Will Deacon, Robin Murphy, Joerg Roedel, linux-arm-kernel, iommu
Cc: kernel-janitors, linux-kernel, llvm
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]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/iommu/arm/arm-smmu/arm-smmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c
index 4bc75c4ce402..f83d2c32b5a9 100644
--- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
@@ -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++;
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] iommu/arm-smmu: remove redundant assignment to variable res
2022-02-25 9:32 [PATCH] iommu/arm-smmu: remove redundant assignment to variable res Colin Ian King
@ 2022-02-25 14:32 ` Robin Murphy
0 siblings, 0 replies; 2+ messages in thread
From: Robin Murphy @ 2022-02-25 14:32 UTC (permalink / raw)
To: Colin Ian King, Will Deacon, Joerg Roedel, linux-arm-kernel, iommu
Cc: kernel-janitors, linux-kernel, llvm
On 2022-02-25 09:32, Colin Ian King wrote:
> 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/20211223130046.9365-2-prabhakar.mahadev-lad.rj@bp.renesas.com/
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> drivers/iommu/arm/arm-smmu/arm-smmu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c
> index 4bc75c4ce402..f83d2c32b5a9 100644
> --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
> @@ -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++;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-25 14:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-25 9:32 [PATCH] iommu/arm-smmu: remove redundant assignment to variable res Colin Ian King
2022-02-25 14:32 ` Robin Murphy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®