kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu: remove redundant assignment to variable agaw
@ 2021-04-16 17:18 Colin King
  2021-06-09  7:37 ` Lu Baolu
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-04-16 17:18 UTC (permalink / raw)
  To: David Woodhouse, Lu Baolu, Joerg Roedel, Will Deacon, iommu
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The variable agaw is initialized with a value that is never
read and it is being updated later with a new value as a
counter in a for-loop. The initialization is redundant and
can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/iommu/intel/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/intel/iommu.c b/drivers/iommu/intel/iommu.c
index 0e04d450c38a..171dd4844ab2 100644
--- a/drivers/iommu/intel/iommu.c
+++ b/drivers/iommu/intel/iommu.c
@@ -564,7 +564,7 @@ static inline int domain_pfn_supported(struct dmar_domain *domain,
 static int __iommu_calculate_agaw(struct intel_iommu *iommu, int max_gaw)
 {
 	unsigned long sagaw;
-	int agaw = -1;
+	int agaw;
 
 	sagaw = cap_sagaw(iommu->cap);
 	for (agaw = width_to_agaw(max_gaw);
-- 
2.30.2


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

* Re: [PATCH] iommu: remove redundant assignment to variable agaw
  2021-04-16 17:18 [PATCH] iommu: remove redundant assignment to variable agaw Colin King
@ 2021-06-09  7:37 ` Lu Baolu
  0 siblings, 0 replies; 2+ messages in thread
From: Lu Baolu @ 2021-06-09  7:37 UTC (permalink / raw)
  To: Colin King, David Woodhouse, Joerg Roedel, Will Deacon, iommu
  Cc: baolu.lu, kernel-janitors, linux-kernel

On 4/17/21 1:18 AM, Colin King wrote:
> From: Colin Ian King<colin.king@canonical.com>
> 
> The variable agaw is initialized with a value that is never
> read and it is being updated later with a new value as a
> counter in a for-loop. The initialization is redundant and
> can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King<colin.king@canonical.com>

Queued for v5.14. Thanks!

Best regards,
baolu

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

end of thread, other threads:[~2021-06-09  7:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-16 17:18 [PATCH] iommu: remove redundant assignment to variable agaw Colin King
2021-06-09  7:37 ` Lu Baolu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).