Skip to contentSkip to conversation

mkfs.f2fs: split unused parameter

PATCH New Jaegeuk Kim 1 participant 1 message May 25, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mkfs.f2fs: split unused parameter

external/f2fs-tools/mkfs/f2fs_format_utils.c:51:28: error: unused parameter 'i' [-Werror,-Wunused-parameter]

---
 mkfs/f2fs_format_utils.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
mkfs/f2fs_format_utils.c +12 -5
index e3c58936e968..fdd0235d81aa 100644
@@ -48,10 +48,10 @@
 #endif
 #endif
 
-static int trim_device(int i)
-{
 #if defined(FALLOC_FL_PUNCH_HOLE) || defined(BLKDISCARD) || \
 	defined(BLKSECDISCARD)
+static int trim_device(int i)
+{
 	unsigned long long range[2];
 	struct stat *stat_buf;
 	struct device_info *dev = c.devices + i;
@@ -110,13 +110,18 @@ static int trim_device(int i)
 	}
 #endif
 	free(stat_buf);
-#endif
 	return 0;
 }
+#else
+static int trim_device(int UNUSED(i))
+{
+	return 0;
+}
+#endif
 
+#ifdef WITH_ANDROID
 static bool is_wiped_device(int i)
 {
-#ifdef WITH_ANDROID
 	struct device_info *dev = c.devices + i;
 	int fd = dev->fd;
 	char *buf, *zero_buf;
@@ -157,9 +162,11 @@ static bool is_wiped_device(int i)
 		MSG(0, "Info: Found all zeros in first %d blocks\n", nblocks);
 	return wiped;
 #else
+static bool is_wiped_device(int UNUSED(i))
+{
 	return false;
-#endif
 }
+#endif
 
 int f2fs_trim_devices(void)
 {
Signature · 8 lines
2.36.1.124.g0e6072fb45-goog



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel