commit: 1be94420d29fa6d0844e37f169c48536c7be8e7f
parent 92b3f5b3779c6ad07c286b3d1cc0d3c6b8445ecf
Author: Michael Forney <mforney@mforney.org>
Date: Fri, 5 Jun 2020 02:21:56 -0700
f2fs-tools: Fix/disable some warnings
Diffstat:
4 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/.gitmodules b/.gitmodules
@@ -65,6 +65,7 @@
[submodule "pkg/f2fs-tools/src"]
path = pkg/f2fs-tools/src
url = https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git
+ ignore = all
[submodule "pkg/farbfeld/src"]
path = pkg/farbfeld/src
url = git://git.suckless.org/farbfeld
diff --git a/pkg/f2fs-tools/gen.lua b/pkg/f2fs-tools/gen.lua
@@ -1,5 +1,5 @@
cflags{
- '-Wall',
+ '-Wall', '-Wno-address-of-packed-member',
'-D HAVE_CONFIG_H',
'-I $dir',
'-I $srcdir/include',
diff --git a/pkg/f2fs-tools/patch/0001-Prevent-unused-but-set-variables.patch b/pkg/f2fs-tools/patch/0001-Prevent-unused-but-set-variables.patch
@@ -0,0 +1,44 @@
+From 19375b1476921178f4af5a74708239b3671cd56e Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Fri, 5 Jun 2020 02:10:12 -0700
+Subject: [PATCH] Prevent unused-but-set variables
+
+---
+ mkfs/f2fs_format_utils.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/mkfs/f2fs_format_utils.c b/mkfs/f2fs_format_utils.c
+index f2d55ad..76f5a1e 100644
+--- a/mkfs/f2fs_format_utils.c
++++ b/mkfs/f2fs_format_utils.c
+@@ -49,11 +49,13 @@
+ static int trim_device(int i)
+ {
+ #ifndef ANDROID_WINDOWS_HOST
+- unsigned long long range[2];
+ struct stat *stat_buf;
+ struct device_info *dev = c.devices + i;
+- u_int64_t bytes = dev->total_sectors * dev->sector_size;
+ int fd = dev->fd;
++#if defined(WITH_BLKDISCARD) && defined(BLKDISCARD)
++ unsigned long long range[2];
++ u_int64_t bytes = dev->total_sectors * dev->sector_size;
++#endif
+
+ stat_buf = malloc(sizeof(struct stat));
+ if (stat_buf == NULL) {
+@@ -67,10 +69,10 @@ static int trim_device(int i)
+ return -1;
+ }
+
++#if defined(WITH_BLKDISCARD) && defined(BLKDISCARD)
+ range[0] = 0;
+ range[1] = bytes;
+
+-#if defined(WITH_BLKDISCARD) && defined(BLKDISCARD)
+ MSG(0, "Info: [%s] Discarding device\n", dev->path);
+ if (S_ISREG(stat_buf->st_mode)) {
+ #if defined(HAVE_FALLOCATE) && defined(FALLOC_FL_PUNCH_HOLE)
+--
+2.27.0
+
diff --git a/pkg/f2fs-tools/ver b/pkg/f2fs-tools/ver
@@ -1 +1 @@
-1.13.0 r0
+1.13.0 r1