Skip to content

Commit

Permalink
erofs-utils: fix some style problems
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Huang Jianan <[email protected]>
Signed-off-by: Gao Xiang <[email protected]>
  • Loading branch information
hjn-1 authored and hsiangkao committed Mar 3, 2022
1 parent b254ce8 commit 1ab11aa
Show file tree
Hide file tree
Showing 11 changed files with 6 additions and 13 deletions.
1 change: 0 additions & 1 deletion fuse/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion include/erofs/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion include/erofs/dir.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion include/erofs/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion lib/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions lib/compressor_liblzma.c
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*/
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion lib/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions lib/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion mkfs/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1ab11aa

Please sign in to comment.