diff mbox series

[2/4] btrfs-progs: tests/fsstress.c: move do_mmap under HAVE_SYS_MMAN_H

Message ID 08a12fed33d557de42bd74a010550689f9eaca3a.1687485959.git.anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: tests: fix warnings during make test | expand

Commit Message

Anand Jain June 23, 2023, 7:59 a.m. UTC
Move the entire 'do_mmap' function under the 'HAVE_SYS_MMAN_H' define
and fix the following warnings. This function is called only when
'HAVE_SYS_MMAN_H' is defined.

tests/fsstress.c:4363:1: warning: ‘do_mmap’ defined but not used [-Wunused-function]
 4363 | do_mmap(opnum_t opno, long r, int prot)

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 tests/fsstress.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tests/fsstress.c b/tests/fsstress.c
index f7d3a83a4e2e..692d7cfacaf4 100644
--- a/tests/fsstress.c
+++ b/tests/fsstress.c
@@ -4359,10 +4359,10 @@  struct print_flags mmap_flags[] = {
 	({translate_flags(flags, "|", mmap_flags);})
 #endif
 
+#ifdef HAVE_SYS_MMAN_H
 static void
 do_mmap(opnum_t opno, long r, int prot)
 {
-#ifdef HAVE_SYS_MMAN_H
 	char		*addr;
 	int		e;
 	pathname_t	f;
@@ -4454,8 +4454,8 @@  do_mmap(opnum_t opno, long r, int prot)
 
 	free_pathname(&f);
 	close(fd);
-#endif
 }
+#endif
 
 void
 mread_f(opnum_t opno, long r)