Skip to contentSkip to conversation

Clean up hugemmap02 testcase

PATCH New [email protected] 2 participants 2 messages Feb 17, 2016 – Feb 25, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 Clean up hugemmap02 testcase

From: Shuang Qiu <[email protected]>

* Remove continue in the loop because it skips the cleanup

* munmap() addr2 for 32-bit

* close nfildes fd in the end of loop

---
 testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c +1 -6
index 1a44993..d31609d 100644
@@ -158,8 +158,6 @@ int main(int ac, char **av)
 		if (addr2 == MAP_FAILED) {
 			tst_resm(TFAIL | TERRNO, "huge mmap failed unexpectedly"
 				 " with %s (64-bit)", TEMPFILE);
-			close(fildes);
-			continue;
 		} else {
 			tst_resm(TPASS, "huge mmap succeeded (64-bit)");
 		}
@@ -170,8 +168,6 @@ int main(int ac, char **av)
 		else if (addr2 > 0) {
 			tst_resm(TCONF,
 				 "huge mmap failed to test the scenario");
-			close(fildes);
-			continue;
 		} else if (addr == 0)
 			tst_resm(TPASS, "huge mmap succeeded (32-bit)");
 #endif
@@ -183,13 +179,12 @@ int main(int ac, char **av)
 					 "munmap of addrlist[%d] failed", i);
 		}
 
-#if __WORDSIZE == 64
 		if (munmap(addr2, map_sz) == -1)
 			tst_brkm(TFAIL | TERRNO, NULL, "huge munmap failed");
-#endif
 		if (munmap(addr, page_sz) == -1)
 			tst_brkm(TFAIL | TERRNO, NULL, "munmap failed");
 
+		close(nfildes);
 		close(fildes);
 	}
 
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v3 1/1 Clean up hugemmap02 testcase

Hi,

Quoted 8 lines · On 02/17/2016 11:22 AM, [email protected] wrote:

From: Shuang Qiu <[email protected]>

* Remove continue in the loop because it skips the cleanup

* munmap() addr2 for 32-bit

* close nfildes fd in the end of loop

Slightly changed the commit subject and applied.

Best regards,
Alexey