Skip to contentSkip to conversation

iommu: remove variable cnt

PATCH In review Colin Ian King 4 participants 4 messages Oct 24, 2022 – Nov 3, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommu: remove variable cnt

Variable cnt is just being incremented and it's never used anywhere else. The variable and the increment are redundant so remove it.

---
 drivers/iommu/amd/iommu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/iommu/amd/iommu.c +1 -2
index d3b39d0416fa..3847f3bdc568 100644
@@ -767,7 +767,7 @@ EXPORT_SYMBOL(amd_iommu_register_ga_log_notifier);
 
 static void iommu_poll_ga_log(struct amd_iommu *iommu)
 {
-	u32 head, tail, cnt = 0;
+	u32 head, tail;
 
 	if (iommu->ga_log == NULL)
 		return;
@@ -780,7 +780,6 @@ static void iommu_poll_ga_log(struct amd_iommu *iommu)
 		u64 log_entry;
 
 		raw = (u64 *)(iommu->ga_log + head);
-		cnt++;
 
 		/* Avoid memcpy function-call overhead */
 		log_entry = *raw;
Signature · 1 line
2.37.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 33 lines · Colin Ian King

Variable cnt is just being incremented and it's never used anywhere else. The variable and the increment are redundant so remove it.

---
 drivers/iommu/amd/iommu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/iommu/amd/iommu.c +1 -2
index d3b39d0416fa..3847f3bdc568 100644
@@ -767,7 +767,7 @@ EXPORT_SYMBOL(amd_iommu_register_ga_log_notifier);
 
 static void iommu_poll_ga_log(struct amd_iommu *iommu)
 {
-	u32 head, tail, cnt = 0;
+	u32 head, tail;
 
 	if (iommu->ga_log == NULL)
 		return;
@@ -780,7 +780,6 @@ static void iommu_poll_ga_log(struct amd_iommu *iommu)
 		u64 log_entry;
 
 		raw = (u64 *)(iommu->ga_log + head);
-		cnt++;
 
 		/* Avoid memcpy function-call overhead */
 		log_entry = *raw;
Signature · 1 line
2.37.3
maintainer
#3 lore raw
In reply to Colin Ian King
Quoted 8 lines · Colin Ian King

Variable cnt is just being incremented and it's never used anywhere else. The variable and the increment are redundant so remove it.

---
 drivers/iommu/amd/iommu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Adjusted subject and applied to x86/amd branch, thanks.