[PATCH v2] erofs-utils: fix some style problems

Huang Jianan huangjianan at oppo.com
Thu Mar 3 14:10:55 AEDT 2022


Fix some minor issues, including:
  - Spelling mistakes;
  - Remove redundant spaces and parenthesis;
  - clean up file headers;
  - Match parameters with format parameters.

Signed-off-by: Huang Jianan <huangjianan at oppo.com>
---
Changes since v1:
 - Removed modification related to alignment format;

 fuse/main.c              | 1 -
 include/erofs/defs.h     | 1 -
 include/erofs/dir.h      | 2 +-
 include/erofs/list.h     | 1 -
 lib/cache.c              | 1 -
 lib/compressor_liblzma.c | 2 --
 lib/inode.c              | 2 +-
 lib/io.c                 | 2 +-
 lib/namei.c              | 1 -
 lib/super.c              | 4 ++--
 mkfs/main.c              | 2 +-
 11 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/fuse/main.c b/fuse/main.c
index b869a00..90ed611 100644
--- a/fuse/main.c
+++ b/fuse/main.c
@@ -61,7 +61,6 @@ int erofsfuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
 #else
 	return erofs_iterate_dir(&ctx.ctx, true);
 #endif
-
 }
 
 static void *erofsfuse_init(struct fuse_conn_info *info)
diff --git a/include/erofs/defs.h b/include/erofs/defs.h
index e745bc0..e5aa23c 100644
--- a/include/erofs/defs.h
+++ b/include/erofs/defs.h
@@ -61,7 +61,6 @@ typedef int16_t         s16;
 typedef int32_t         s32;
 typedef int64_t         s64;
 
-
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 /*
  * The host byte order is the same as network byte order,
diff --git a/include/erofs/dir.h b/include/erofs/dir.h
index 1627d3d..74bffb5 100644
--- a/include/erofs/dir.h
+++ b/include/erofs/dir.h
@@ -42,7 +42,7 @@ struct erofs_dir_context {
 	/*
 	 * During execution of |erofs_iterate_dir|, the function needs to
 	 * read the values inside |erofs_inode* dir|. So it is important
-	 * that the callback function does not modify stuct pointed by
+	 * that the callback function does not modify struct pointed by
 	 * |dir|. It is OK to repoint |dir| to other objects.
 	 * Unfortunately, it's not possible to enforce this restriction
 	 * with const keyword, as |erofs_iterate_dir| needs to modify
diff --git a/include/erofs/list.h b/include/erofs/list.h
index 2a0e961..3f5da1a 100644
--- a/include/erofs/list.h
+++ b/include/erofs/list.h
@@ -110,7 +110,6 @@ static inline int list_empty(struct list_head *head)
 	     &pos->member != (head);                                           \
 	     pos = n, n = list_next_entry(n, member))
 
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/lib/cache.c b/lib/cache.c
index f820c0b..c735363 100644
--- a/lib/cache.c
+++ b/lib/cache.c
@@ -331,7 +331,6 @@ struct erofs_buffer_head *erofs_battach(struct erofs_buffer_head *bh,
 		return ERR_PTR(ret);
 	}
 	return nbh;
-
 }
 
 static erofs_blk_t __erofs_mapbh(struct erofs_buffer_block *bb)
diff --git a/lib/compressor_liblzma.c b/lib/compressor_liblzma.c
index acf442f..4886d6a 100644
--- a/lib/compressor_liblzma.c
+++ b/lib/compressor_liblzma.c
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+ OR Apache-2.0
 /*
- * erofs-utils/lib/compressor_liblzma.c
- *
  * Copyright (C) 2021 Gao Xiang <xiang at kernel.org>
  */
 #include <stdlib.h>
diff --git a/lib/inode.c b/lib/inode.c
index e680b23..5db4691 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -1108,7 +1108,7 @@ fail:
 		d->type = ftype;
 
 		erofs_d_invalidate(d);
-		erofs_info("add file %s/%s (nid %llu, type %d)",
+		erofs_info("add file %s/%s (nid %llu, type %u)",
 			   dir->i_srcpath, d->name, (unsigned long long)d->nid,
 			   d->type);
 	}
diff --git a/lib/io.c b/lib/io.c
index 5bc3432..9c663c5 100644
--- a/lib/io.c
+++ b/lib/io.c
@@ -370,7 +370,7 @@ ssize_t erofs_copy_file_range(int fd_in, erofs_off_t *off_in,
 	ssize_t ret;
 
 	ret = copy_file_range(fd_in, &off64_in, fd_out, &off64_out,
-                              length, 0);
+			      length, 0);
 	if (ret >= 0)
 		goto out;
 	if (errno != ENOSYS) {
diff --git a/lib/namei.c b/lib/namei.c
index 97f0f80..6163238 100644
--- a/lib/namei.c
+++ b/lib/namei.c
@@ -144,7 +144,6 @@ bogusimode:
 	return -EFSCORRUPTED;
 }
 
-
 struct erofs_dirent *find_target_dirent(erofs_nid_t pnid,
 					void *dentry_blk,
 					const char *name, unsigned int len,
diff --git a/lib/super.c b/lib/super.c
index 69522bd..f486eb7 100644
--- a/lib/super.c
+++ b/lib/super.c
@@ -15,7 +15,7 @@ static bool check_layout_compatibility(struct erofs_sb_info *sbi,
 	sbi->feature_incompat = feature;
 
 	/* check if current kernel meets all mandatory requirements */
-	if (feature & (~EROFS_ALL_FEATURE_INCOMPAT)) {
+	if (feature & ~EROFS_ALL_FEATURE_INCOMPAT) {
 		erofs_err("unidentified incompatible feature %x, please upgrade kernel version",
 			  feature & ~EROFS_ALL_FEATURE_INCOMPAT);
 		return false;
@@ -87,7 +87,7 @@ int erofs_read_superblock(void)
 	blkszbits = dsb->blkszbits;
 	/* 9(512 bytes) + LOG_SECTORS_PER_BLOCK == LOG_BLOCK_SIZE */
 	if (blkszbits != LOG_BLOCK_SIZE) {
-		erofs_err("blksize %u isn't supported on this platform",
+		erofs_err("blksize %d isn't supported on this platform",
 			  1 << blkszbits);
 		return ret;
 	}
diff --git a/mkfs/main.c b/mkfs/main.c
index 282126a..0724212 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -204,7 +204,7 @@ static int mkfs_parse_options_cfg(int argc, char *argv[])
 	bool quiet = false;
 
 	while ((opt = getopt_long(argc, argv, "C:E:T:U:d:x:z:",
-				 long_options, NULL)) != -1) {
+				  long_options, NULL)) != -1) {
 		switch (opt) {
 		case 'z':
 			if (!optarg) {
-- 
2.25.1



More information about the Linux-erofs mailing list