Skip to contentSkip to conversation

libzone: remove duplicate header

PATCH New Jaegeuk Kim 1 participant 4 messages May 25, 2022 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 libzone: remove duplicate header

---
 lib/libf2fs_zoned.c | 2 --
 1 file changed, 2 deletions(-)
lib/libf2fs_zoned.c +0 -2
index c5c6ddee7cdd..f383ce275342 100644
@@ -27,8 +27,6 @@
 #endif
 #include <libgen.h>
 
-#include <f2fs_fs.h>
-
 #ifdef HAVE_LINUX_BLKZONED_H
 
 int get_sysfs_path(struct device_info *dev, const char *attr,
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
#1 lore raw

PATCH 2/4 Remove unnecessary config.h

Instead, we should use <config.h> generated by configure.

---
 fsck/dict.c             | 1 -
 fsck/mkquota.c          | 2 +-
 fsck/quotaio.c          | 1 -
 fsck/quotaio_tree.c     | 1 -
 fsck/quotaio_v2.c       | 1 -
 lib/nls_utf8.c          | 3 +--
 mkfs/f2fs_format.c      | 2 --
 mkfs/f2fs_format_main.c | 4 ++--
 tools/f2fs_io/f2fs_io.c | 2 +-
 tools/f2fscrypt.c       | 1 -
 tools/sha512.c          | 1 -
 11 files changed, 5 insertions(+), 14 deletions(-)
fsck/dict.c +0 -1
index bb7600cc4fae..5b875bed81b3 100644
@@ -20,7 +20,6 @@
 
 #define DICT_NODEBUG
 
-#include "config.h"
 #include <stdlib.h>
 #include <stddef.h>
 #ifdef DICT_NODEBUG
fsck/mkquota.c +1 -1
index c419a0fe2078..d18141e2460f 100644
@@ -4,7 +4,7 @@
  * Aditya Kali <[email protected]>
  * Hyojun Kim <[email protected]> - Ported to f2fs-tools
  */
-#include "config.h"
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
fsck/quotaio.c +0 -1
index a3815b0c8835..d02475287c91 100644
@@ -6,7 +6,6 @@
  * Hyojun Kim <[email protected]> - Ported to f2fs-tools
  */
 
-#include "config.h"
 #include <stdio.h>
 #include <errno.h>
 #include <string.h>
fsck/quotaio_tree.c +0 -1
index c2034005cfe0..40521c54c436 100644
@@ -5,7 +5,6 @@
  * Hyojun Kim <[email protected]> - Ported to f2fs-tools
  */
 
-#include "config.h"
 #include <sys/types.h>
 #include <errno.h>
 #include <stdio.h>
fsck/quotaio_v2.c +0 -1
index 9353f8567647..e19f303d96ea 100644
@@ -5,7 +5,6 @@
  * Hyojun Kim <[email protected]> - Ported to f2fs-tools
  */
 
-#include "config.h"
 #include <sys/types.h>
 #include <errno.h>
 #include <stdio.h>
lib/nls_utf8.c +1 -2
index 9e7590deb338..e6f34ba60b18 100644
@@ -20,14 +20,13 @@
  * implementation.
  */
 
-#include "config.h"
 #include <stdint.h>
 #include <unistd.h>
 #include <string.h>
 #include <limits.h>
 #include <errno.h>
 
-#include "f2fs_fs.h"
+#include <f2fs_fs.h>
 
 /* Encoding a unicode version number as a single unsigned int. */
 #define UNICODE_MAJ_SHIFT		(16)
mkfs/f2fs_format.c +0 -2
index 3b96d3182ac8..7cd5815e1f80 100644
@@ -8,8 +8,6 @@
  */
 #define _LARGEFILE64_SOURCE
 
-#include "config.h"
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>
mkfs/f2fs_format_main.c +2 -2
index b8936f15e0f2..d2c2605ae6a5 100644
@@ -22,7 +22,8 @@
 #include <errno.h>
 #include <getopt.h>
 
-#include "config.h"
+#include <f2fs_fs.h>
+
 #ifdef HAVE_LIBBLKID
 #include <blkid/blkid.h>
 #endif
@@ -30,7 +31,6 @@
 #include <uuid/uuid.h>
 #endif
 
-#include "f2fs_fs.h"
 #include "quota.h"
 #include "f2fs_format_utils.h"
 
tools/f2fs_io/f2fs_io.c +1 -1
index 0edac6fedf33..2f0fc7b25d41 100644
@@ -43,7 +43,7 @@
 #include <unistd.h>
 
 #ifdef HAVE_CONFIG_H
-#include "config.h"
+#include <config.h>
 #endif
 #include <android_config.h>
 
tools/f2fscrypt.c +0 -1
index 1233f3a5b103..8640ffae1404 100644
@@ -20,7 +20,6 @@
 #define _GNU_SOURCE
 #endif
 
-#include "config.h"
 #include <f2fs_fs.h>
 
 #include <assert.h>
tools/sha512.c +0 -1
index bf0d9a4efaef..c6d35afa7e2c 100644
@@ -11,7 +11,6 @@
  */
 
 
-#include "config.h"
 #include <assert.h>
 #include <errno.h>
 #include <getopt.h>
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
#2 lore raw

PATCH 3/4 Fix dependencies on linux/blkzoned.h when using Bionic.

In reply to Jaegeuk Kim

From: Martin Stjernholm <[email protected]>

This reverts commit adcec10b4dee ("Support zoned device if libc exists).

---
 include/android_config.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
include/android_config.h +1 -2
index 07440874188c..21eed28669e1 100644
@@ -41,8 +41,7 @@
 #define HAVE_LIBSELINUX 1
 #endif
 
-#ifdef WITH_LIBC
-#define HAVE_KERNEL_UAPI_LINUX_BLKZONED_H 1
+#if defined(__BIONIC__)
 #define HAVE_LINUX_BLKZONED_H 1
 #endif
 
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
#3 lore raw

PATCH 4/4 avoid unnecessary function

In reply to Jaegeuk Kim

libf2fs.c:883:12: warning: unused function 'is_power_of_2' [-Wunused-function]

---
 lib/libf2fs.c | 2 ++
 1 file changed, 2 insertions(+)
lib/libf2fs.c +2 -0
index ad8d1bd03509..36b8c25980ab 100644
@@ -880,10 +880,12 @@ static int open_check_fs(char *path, int flag)
 	return open(path, O_RDONLY | flag);
 }
 
+#ifdef __linux__
 static int is_power_of_2(unsigned long n)
 {
 	return (n != 0 && ((n & (n - 1)) == 0));
 }
+#endif
 
 int get_device_info(int i)
 {
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