aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-09-15 16:03:18 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2021-09-15 16:03:18 +0000
commitcd16a848d1b34016b1a1c663223729a92c247be3 (patch)
treefd4c43cd4cc3cec04fc4b786c35c18ca82a55978
parentdf005aa9b3d8d5bf78bff749b261e9ae5bea80a3 (diff)
downloadsrc-cd16a848d1b34016b1a1c663223729a92c247be3.tar.gz
src-cd16a848d1b34016b1a1c663223729a92c247be3.zip
posixshmtest: Fix various warnings raised by GCC.
- Remove unused format string arguments. - Remove a set but unused variable. Reviewed by: khng, kib Differential Revision: https://reviews.freebsd.org/D31946
-rw-r--r--tests/sys/posixshm/posixshm_test.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/sys/posixshm/posixshm_test.c b/tests/sys/posixshm/posixshm_test.c
index eddb1d2d8250..b460639ba647 100644
--- a/tests/sys/posixshm/posixshm_test.c
+++ b/tests/sys/posixshm/posixshm_test.c
@@ -1105,7 +1105,7 @@ ATF_TC_BODY(fspacectl, tc)
ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0,
"Aligned fspacectl failed; errno=%d", errno);
ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0,
- "Aligned fspacectl content checking failed", errno);
+ "Aligned fspacectl content checking failed");
/* Unaligned fspacectl(fd, SPACECTL_DEALLOC, ...) */
ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0);
@@ -1115,7 +1115,7 @@ ATF_TC_BODY(fspacectl, tc)
ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0,
"Unaligned fspacectl failed; errno=%d", errno);
ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0,
- "Unaligned fspacectl content checking failed", errno);
+ "Unaligned fspacectl content checking failed");
/* Aligned fspacectl(fd, SPACECTL_DEALLOC, ...) to OFF_MAX */
ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0);
@@ -1124,7 +1124,7 @@ ATF_TC_BODY(fspacectl, tc)
ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0,
"Aligned fspacectl to OFF_MAX failed; errno=%d", errno);
ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0,
- "Aligned fspacectl to OFF_MAX content checking failed", errno);
+ "Aligned fspacectl to OFF_MAX content checking failed");
/* Unaligned fspacectl(fd, SPACECTL_DEALLOC, ...) to OFF_MAX */
ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0);
@@ -1133,7 +1133,7 @@ ATF_TC_BODY(fspacectl, tc)
ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0,
"Unaligned fspacectl to OFF_MAX failed; errno=%d", errno);
ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0,
- "Unaligned fspacectl to OFF_MAX content checking failed", errno);
+ "Unaligned fspacectl to OFF_MAX content checking failed");
/* Aligned fspacectl(fd, SPACECTL_DEALLOC, ...) past shm_sz */
ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0);
@@ -1142,7 +1142,7 @@ ATF_TC_BODY(fspacectl, tc)
ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0,
"Aligned fspacectl past shm_sz failed; errno=%d", errno);
ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0,
- "Aligned fspacectl past shm_sz content checking failed", errno);
+ "Aligned fspacectl past shm_sz content checking failed");
/* Unaligned fspacectl(fd, SPACECTL_DEALLOC, ...) past shm_sz */
ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0);
@@ -1151,7 +1151,7 @@ ATF_TC_BODY(fspacectl, tc)
ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0,
"Unaligned fspacectl past shm_sz failed; errno=%d", errno);
ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0,
- "Unaligned fspacectl past shm_sz content checking failed", errno);
+ "Unaligned fspacectl past shm_sz content checking failed");
ATF_REQUIRE(close(fd) == 0);
}
@@ -1251,9 +1251,7 @@ ATF_TC_BODY(largepage_config, tc)
struct shm_largepage_conf lpc;
char *addr, *buf;
size_t ps[MAXPAGESIZES + 1]; /* silence warnings if MAXPAGESIZES == 1 */
- int error, fd, pscnt;
-
- pscnt = pagesizes(ps);
+ int error, fd;
fd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0);
ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; error=%d", errno);