Skip to contentSkip to conversation

iommu/vt-d: move variable to more local scope

PATCH New Rolf Eike Beer 1 participant 1 message Jun 3, 2021

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

PATCH 1/1 iommu/vt-d: move variable to more local scope

It is only used inside the loop and the old value is not reused.

---
 drivers/iommu/intel/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/intel/iommu.c +1 -1
index be35284a2016..fa262b805dd6 100644
@@ -2340,7 +2340,6 @@ __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn,
 		 unsigned long phys_pfn, unsigned long nr_pages, int prot)
 {
 	unsigned int largepage_lvl = 0;
-	unsigned long lvl_pages = 0;
 	struct dma_pte *pte = NULL;
 	phys_addr_t pteval;
 	u64 attr;
@@ -2366,6 +2365,7 @@ __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn,
 
 	while (nr_pages > 0) {
 		uint64_t tmp;
+		unsigned long lvl_pages;
 
 		if (!pte) {
 			largepage_lvl = hardware_largepage_caps(domain, iov_pfn,
Signature · 11 lines
2.31.1


-- 
Rolf Eike Beer, emlix GmbH, https://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055

emlix - smart embedded open source