From 1ab11aae4b78a4b0f75fa65047d2c419d4307dbb Mon Sep 17 00:00:00 2001 From: Huang Jianan Date: Thu, 3 Mar 2022 11:10:55 +0800 Subject: [PATCH] erofs-utils: fix some style problems Fix some minor issues, including: - Spelling mistakes; - Remove redundant spaces and parenthesis; - clean up file headers; - Match parameters with format parameters. Link: https://lore.kernel.org/r/20220303031055.2433-1-huangjianan@oppo.com Signed-off-by: Huang Jianan Signed-off-by: Gao Xiang --- 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 b869a00e..90ed6115 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 e745bc0a..e5aa23c8 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 1627d3de..74bffb53 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 2a0e9616..3f5da1a5 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 f820c0b8..c7353636 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 acf442fa..4886d6af 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 */ #include diff --git a/lib/inode.c b/lib/inode.c index e680b23c..5db46915 100644 --- a/lib/inode.c +++ b/lib/inode.c @@ -1108,7 +1108,7 @@ static struct erofs_inode *erofs_mkfs_build_tree(struct erofs_inode *dir) 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 5bc3432c..9c663c57 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 97f0f804..61632389 100644 --- a/lib/namei.c +++ b/lib/namei.c @@ -144,7 +144,6 @@ int erofs_read_inode_from_disk(struct erofs_inode *vi) 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 69522bda..f486eb78 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 282126a9..0724212f 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) {