syscalls/mmap: Remove check for getpagesize() < 0
1. The getpagesize() never fails
2. The condition is always false due to conversion
to unsigned size_t
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
diff --git a/testcases/kernel/syscalls/mmap/mmap01.c b/testcases/kernel/syscalls/mmap/mmap01.c
index 8648384..c44860f 100644
--- a/testcases/kernel/syscalls/mmap/mmap01.c
+++ b/testcases/kernel/syscalls/mmap/mmap01.c
@@ -183,11 +183,7 @@
}
file_sz = stat_buf.st_size;
- /* Get the system page size */
- if ((page_sz = getpagesize()) < 0) {
- tst_brkm(TFAIL, cleanup,
- "getpagesize() fails to get system page size");
- }
+ page_sz = getpagesize();
/* Allocate and initialize dummy string of system page size bytes */
if ((dummy = calloc(page_sz, sizeof(char))) == NULL) {
diff --git a/testcases/kernel/syscalls/mmap/mmap02.c b/testcases/kernel/syscalls/mmap/mmap02.c
index 7075809..88488e7 100644
--- a/testcases/kernel/syscalls/mmap/mmap02.c
+++ b/testcases/kernel/syscalls/mmap/mmap02.c
@@ -132,11 +132,7 @@
TEST_PAUSE;
- /* Get the system page size */
- if ((page_sz = getpagesize()) < 0) {
- tst_brkm(TFAIL, NULL,
- "getpagesize() fails to get system page size");
- }
+ page_sz = getpagesize();
/* Allocate space for the test buffer */
if ((tst_buff = calloc(page_sz, sizeof(char))) == NULL) {
diff --git a/testcases/kernel/syscalls/mmap/mmap03.c b/testcases/kernel/syscalls/mmap/mmap03.c
index 78a5d4d..af49599 100644
--- a/testcases/kernel/syscalls/mmap/mmap03.c
+++ b/testcases/kernel/syscalls/mmap/mmap03.c
@@ -164,11 +164,7 @@
TEST_PAUSE;
- /* Get the system page size */
- if ((page_sz = getpagesize()) < 0) {
- tst_brkm(TFAIL, NULL,
- "getpagesize() fails to get system page size");
- }
+ page_sz = getpagesize();
/* Allocate space for the test buffer */
if ((tst_buff = calloc(page_sz, sizeof(char))) == NULL) {
diff --git a/testcases/kernel/syscalls/mmap/mmap04.c b/testcases/kernel/syscalls/mmap/mmap04.c
index da71926..c9b2c74 100644
--- a/testcases/kernel/syscalls/mmap/mmap04.c
+++ b/testcases/kernel/syscalls/mmap/mmap04.c
@@ -135,10 +135,7 @@
TEST_PAUSE;
- if ((page_sz = getpagesize()) < 0) {
- tst_brkm(TFAIL, NULL,
- "getpagesize() fails to get system page size");
- }
+ page_sz = getpagesize();
if ((tst_buff = calloc(page_sz, sizeof(char))) == NULL) {
tst_brkm(TFAIL, NULL, "calloc failed (tst_buff)");
diff --git a/testcases/kernel/syscalls/mmap/mmap05.c b/testcases/kernel/syscalls/mmap/mmap05.c
index 378160a..1b793b3 100644
--- a/testcases/kernel/syscalls/mmap/mmap05.c
+++ b/testcases/kernel/syscalls/mmap/mmap05.c
@@ -140,11 +140,7 @@
TEST_PAUSE;
- /* Get the system page size */
- if ((page_sz = getpagesize()) < 0) {
- tst_brkm(TFAIL, NULL,
- "getpagesize() fails to get system page size");
- }
+ page_sz = getpagesize();
/* Allocate space for the test buffer */
if ((tst_buff = calloc(page_sz, sizeof(char))) == NULL) {
diff --git a/testcases/kernel/syscalls/mmap/mmap06.c b/testcases/kernel/syscalls/mmap/mmap06.c
index c119c5c..f907255 100644
--- a/testcases/kernel/syscalls/mmap/mmap06.c
+++ b/testcases/kernel/syscalls/mmap/mmap06.c
@@ -117,11 +117,7 @@
TEST_PAUSE;
- /* Get the system page size */
- if ((page_sz = getpagesize()) < 0) {
- tst_brkm(TFAIL, NULL,
- "getpagesize() fails to get system page size");
- }
+ page_sz = getpagesize();
/* Allocate space for the test buffer */
if ((tst_buff = calloc(page_sz, sizeof(char))) == NULL) {
diff --git a/testcases/kernel/syscalls/mmap/mmap07.c b/testcases/kernel/syscalls/mmap/mmap07.c
index ffb124d..bb05cd2 100644
--- a/testcases/kernel/syscalls/mmap/mmap07.c
+++ b/testcases/kernel/syscalls/mmap/mmap07.c
@@ -119,11 +119,7 @@
TEST_PAUSE;
- /* Get the system page size */
- if ((page_sz = getpagesize()) < 0) {
- tst_brkm(TFAIL, NULL,
- "getpagesize() fails to get system page size");
- }
+ page_sz = getpagesize();
/* Allocate space for the test buffer */
if ((tst_buff = calloc(page_sz, sizeof(char))) == NULL) {
diff --git a/testcases/kernel/syscalls/mmap/mmap08.c b/testcases/kernel/syscalls/mmap/mmap08.c
index 9403a7d..43b8678 100644
--- a/testcases/kernel/syscalls/mmap/mmap08.c
+++ b/testcases/kernel/syscalls/mmap/mmap08.c
@@ -111,11 +111,7 @@
TEST_PAUSE;
- /* Get the system page size */
- if ((page_sz = getpagesize()) < 0) {
- tst_brkm(TFAIL, NULL,
- "getpagesize() fails to get system page size");
- }
+ page_sz = getpagesize();
if ((tst_buff = calloc(page_sz, sizeof(char))) == NULL) {
tst_brkm(TFAIL, NULL,