Skip to contentSkip to conversation

erofs-utils: fix checkpatch.pl complains

PATCH Superseded Huang Jianan 3 participants 21 messages Aug 31, 2021 – Sep 3, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover erofs-utils: fix checkpatch.pl complains

From: Huang Jianan <[email protected]>

This patchset fix most of checkpatch.pl complains in erofs-utils, some problems that also exist in the kernel haven't been fixed.

Huang Jianan (5):
erofs-utils: remove filename in the file
erofs-utils: fix SPDX comment style
erofs-utils: fix general style problem
erofs-utils: remove unnecessary codes and comments
erofs-utils: fix print style

 Makefile.am                |  1 -
 fuse/Makefile.am           |  1 -
 fuse/dir.c                 |  2 --
 fuse/macosx.h              |  1 +
 fuse/main.c                |  7 +------
 include/erofs/block_list.h |  8 +++-----
 include/erofs/cache.h      |  2 --
 include/erofs/compress.h   |  2 --
 include/erofs/config.h     |  2 --
 include/erofs/decompress.h |  2 --
 include/erofs/defs.h       |  2 --
 include/erofs/err.h        |  2 --
 include/erofs/exclude.h    |  2 --
 include/erofs/hashtable.h  |  2 --
 include/erofs/inode.h      |  2 --
 include/erofs/internal.h   |  2 --
 include/erofs/io.h         |  2 --
 include/erofs/list.h       |  2 --
 include/erofs/print.h      |  2 --
 include/erofs/trace.h      |  2 --
 include/erofs/xattr.h      |  4 +---
 include/erofs_fs.h         |  1 -
 lib/Makefile.am            |  1 -
 lib/block_list.c           |  7 +------
 lib/cache.c                |  2 --
 lib/compress.c             | 11 ++++-------
 lib/compressor.c           |  4 +---
 lib/compressor.h           |  2 --
 lib/compressor_lz4.c       |  2 --
 lib/compressor_lz4hc.c     |  2 --
 lib/config.c               |  2 --
 lib/data.c                 |  2 --
 lib/decompress.c           |  2 --
 lib/exclude.c              |  2 --
 lib/inode.c                |  9 +--------
 lib/io.c                   |  5 +----
 lib/namei.c                |  5 ++---
 lib/super.c                |  2 --
 lib/xattr.c                |  4 +---
 lib/zmap.c                 |  6 +-----
 man/Makefile.am            |  1 -
 mkfs/Makefile.am           |  1 -
 mkfs/main.c                |  4 +---
 43 files changed, 19 insertions(+), 110 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/5 erofs-utils: remove filename in the file

From: Huang Jianan <[email protected]>

It's generally not useful to have the filename in the file.

---
 Makefile.am                | 1 -
 fuse/Makefile.am           | 1 -
 fuse/dir.c                 | 2 --
 fuse/main.c                | 2 --
 include/erofs/block_list.h | 2 --
 include/erofs/cache.h      | 2 --
 include/erofs/compress.h   | 2 --
 include/erofs/config.h     | 2 --
 include/erofs/decompress.h | 2 --
 include/erofs/defs.h       | 2 --
 include/erofs/err.h        | 2 --
 include/erofs/exclude.h    | 2 --
 include/erofs/hashtable.h  | 2 --
 include/erofs/inode.h      | 2 --
 include/erofs/internal.h   | 2 --
 include/erofs/io.h         | 2 --
 include/erofs/list.h       | 2 --
 include/erofs/print.h      | 2 --
 include/erofs/trace.h      | 2 --
 include/erofs/xattr.h      | 2 --
 include/erofs_fs.h         | 1 -
 lib/Makefile.am            | 1 -
 lib/block_list.c           | 2 --
 lib/cache.c                | 2 --
 lib/compress.c             | 2 --
 lib/compressor.c           | 2 --
 lib/compressor.h           | 2 --
 lib/compressor_lz4.c       | 2 --
 lib/compressor_lz4hc.c     | 2 --
 lib/config.c               | 2 --
 lib/data.c                 | 2 --
 lib/decompress.c           | 2 --
 lib/exclude.c              | 2 --
 lib/inode.c                | 2 --
 lib/io.c                   | 2 --
 lib/namei.c                | 2 --
 lib/super.c                | 2 --
 lib/xattr.c                | 2 --
 lib/zmap.c                 | 2 --
 man/Makefile.am            | 1 -
 mkfs/Makefile.am           | 1 -
 mkfs/main.c                | 2 --
 42 files changed, 78 deletions(-)
Makefile.am +0 -1
index b804aa9..9a49efc 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0+
-# Makefile.am
 
 ACLOCAL_AMFLAGS = -I m4
 
fuse/Makefile.am +0 -1
index e7757bc..962b467 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0+
-# Makefile.am
 
 AUTOMAKE_OPTIONS = foreign
 bin_PROGRAMS     = erofsfuse
fuse/dir.c +0 -2
index e16fda1..9d95ec6 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/fuse/dir.c
- *
  * Created by Li Guifu <[email protected]>
  */
 #include <fuse.h>
fuse/main.c +0 -2
index 5552480..34a9b7a 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/fuse/main.c
- *
  * Created by Li Guifu <[email protected]>
  */
 #include <stdlib.h>
include/erofs/block_list.h +0 -2
index 7756d8a..5127b23 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/include/erofs/block_list.h
- *
  * Copyright (C), 2021, Coolpad Group Limited.
  * Created by Yue Hu <[email protected]>
  */
include/erofs/cache.h +0 -2
index 611ca5b..a249d30 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/cache.h
- *
  * Copyright (C) 2018 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Miao Xie <[email protected]>
include/erofs/compress.h +0 -2
index d234e8b..47fd489 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/compress.h
- *
  * Copyright (C) 2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
include/erofs/config.h +0 -2
index 8124f3b..896049b 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/config.h
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/decompress.h +0 -2
index beaac35..0ba2b08 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/decompress.h
- *
  * Copyright (C), 2008-2020, OPPO Mobile Comm Corp., Ltd.
  * Created by Huang Jianan <[email protected]>
  */
include/erofs/defs.h +0 -2
index 5410685..6e0a777 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/defs.h
- *
  * Copyright (C) 2018 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/err.h +0 -2
index da3b681..2ff77a4 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/err.h
- *
  * Copyright (C) 2018 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/exclude.h +0 -2
index 88c55d7..98217e4 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/exclude.h
- *
  * Created by Li Guifu <[email protected]>
  */
 #ifndef __EROFS_EXCLUDE_H
include/erofs/hashtable.h +0 -2
index 7e47189..a71cb00 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * erofs-utils/include/erofs/hashtable.h
- *
  * Original code taken from 'linux/include/linux/hash{,table}.h'
  */
 #ifndef __EROFS_HASHTABLE_H
include/erofs/inode.h +0 -2
index 5a7f5f1..a736762 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/inode.h
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/internal.h +0 -2
index 5583861..7dc5ff0 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/internal.h
- *
  * Copyright (C) 2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
include/erofs/io.h +0 -2
index 5574245..20b25d0 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/io.h
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/list.h +0 -2
index 3572726..d2bc704 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/list.h
- *
  * Copyright (C) 2018 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/print.h +0 -2
index 6b79074..9c08a50 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/print.h
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/trace.h +0 -2
index 5a12da7..5412ded 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/trace.h
- *
  * Copyright (C) 2020 Gao Xiang <[email protected]>
  */
 #ifndef __EROFS_TRACE_H
include/erofs/xattr.h +0 -2
index 197fe25..5086b54 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/include/erofs/xattr.h
- *
  * Originally contributed by an anonymous person,
  * heavily changed by Li Guifu <[email protected]>
  *                and Gao Xiang <[email protected]>
include/erofs_fs.h +0 -1
index 18fc182..f9cdd71 100644
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0-only OR Apache-2.0 */
 /*
- * erofs-utils/include/erofs_fs.h
  * EROFS (Enhanced ROM File System) on-disk format definition
  *
  * Copyright (C) 2017-2018 HUAWEI, Inc.
lib/Makefile.am +0 -1
index b12e2c1..87e6411 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0+
-# Makefile.am
 
 noinst_LTLIBRARIES = liberofs.la
 noinst_HEADERS = $(top_srcdir)/include/erofs_fs.h \
lib/block_list.c +0 -2
index 3be0992..73c1bde 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/block_list.c
- *
  * Copyright (C), 2021, Coolpad Group Limited.
  * Created by Yue Hu <[email protected]>
  */
lib/cache.c +0 -2
index 340dcdd..0a1c0cf 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/cache.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Miao Xie <[email protected]>
lib/compress.c +0 -2
index a8ebbc1..2b12d67 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/compress.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Miao Xie <[email protected]>
lib/compressor.c +0 -2
index 8836e0c..846a836 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/compressor.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
lib/compressor.h +0 -2
index b2471c4..132bd65 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/lib/compressor.h
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
lib/compressor_lz4.c +0 -2
index 292d0f2..ce8c472 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/compressor-lz4.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
lib/compressor_lz4hc.c +0 -2
index 14c3a71..e345f70 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/compressor-lz4hc.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
lib/config.c +0 -2
index 99fcf49..aa328c4 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/config.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
lib/data.c +0 -2
index 42b4904..32d4c00 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/data.c
- *
  * Copyright (C) 2020 Gao Xiang <[email protected]>
  * Compression support by Huang Jianan <[email protected]>
  */
lib/decompress.c +0 -2
index 490c4bc..2ee1439 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/decompress.c
- *
  * Copyright (C), 2008-2020, OPPO Mobile Comm Corp., Ltd.
  * Created by Huang Jianan <[email protected]>
  */
lib/exclude.c +0 -2
index 73b3720..e9e8b9b 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/exclude.c
- *
  * Created by Li Guifu <[email protected]>
  */
 #include <string.h>
lib/inode.c +0 -2
index 6871d2b..62047d3 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/inode.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
lib/io.c +0 -2
index 6067041..b053137 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/io.c
- *
  * Copyright (C) 2018 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
lib/namei.c +0 -2
index b572d17..f4094a1 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/namei.c
- *
  * Created by Li Guifu <[email protected]>
  */
 #include <sys/types.h>
lib/super.c +0 -2
index 11405ec..c4a67f3 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/super.c
- *
  * Created by Li Guifu <[email protected]>
  */
 #include <string.h>
lib/xattr.c +0 -2
index aff3d67..39d4a96 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/xattr.c
- *
  * Originally contributed by an anonymous person,
  * heavily changed by Li Guifu <[email protected]>
  *                and Gao Xiang <[email protected]>
lib/zmap.c +0 -2
index 1084faa..fdc84af 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/zmap.c
- *
  * (a large amount of code was adapted from Linux kernel. )
  *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
man/Makefile.am +0 -1
index 0df947b..d62d6e2 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0+
-# Makefile.am
 
 dist_man_MANS = mkfs.erofs.1
 
mkfs/Makefile.am +0 -1
index 8b8e051..bcef7e1 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0+
-# Makefile.am
 
 AUTOMAKE_OPTIONS = foreign
 bin_PROGRAMS     = mkfs.erofs
mkfs/main.c +0 -2
index 89f2310..debb754 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * mkfs/main.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH 1/5] erofs-utils: remove filename in the file

Quoted 5 lines · Huang Jianan

From: Huang Jianan <[email protected]>

It's generally not useful to have the filename in the file.

If we decide to clean up this stuff, could we remove trailing newline like the commit below?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/fs/erofs?id=c5fcb51111b85323cafe3f02784f7f0bf6a7cf07

Thanks,
Gao Xiang

Quoted 540 lines
---
 Makefile.am                | 1 -
 fuse/Makefile.am           | 1 -
 fuse/dir.c                 | 2 --
 fuse/main.c                | 2 --
 include/erofs/block_list.h | 2 --
 include/erofs/cache.h      | 2 --
 include/erofs/compress.h   | 2 --
 include/erofs/config.h     | 2 --
 include/erofs/decompress.h | 2 --
 include/erofs/defs.h       | 2 --
 include/erofs/err.h        | 2 --
 include/erofs/exclude.h    | 2 --
 include/erofs/hashtable.h  | 2 --
 include/erofs/inode.h      | 2 --
 include/erofs/internal.h   | 2 --
 include/erofs/io.h         | 2 --
 include/erofs/list.h       | 2 --
 include/erofs/print.h      | 2 --
 include/erofs/trace.h      | 2 --
 include/erofs/xattr.h      | 2 --
 include/erofs_fs.h         | 1 -
 lib/Makefile.am            | 1 -
 lib/block_list.c           | 2 --
 lib/cache.c                | 2 --
 lib/compress.c             | 2 --
 lib/compressor.c           | 2 --
 lib/compressor.h           | 2 --
 lib/compressor_lz4.c       | 2 --
 lib/compressor_lz4hc.c     | 2 --
 lib/config.c               | 2 --
 lib/data.c                 | 2 --
 lib/decompress.c           | 2 --
 lib/exclude.c              | 2 --
 lib/inode.c                | 2 --
 lib/io.c                   | 2 --
 lib/namei.c                | 2 --
 lib/super.c                | 2 --
 lib/xattr.c                | 2 --
 lib/zmap.c                 | 2 --
 man/Makefile.am            | 1 -
 mkfs/Makefile.am           | 1 -
 mkfs/main.c                | 2 --
 42 files changed, 78 deletions(-)
Makefile.am +0 -1
index b804aa9..9a49efc 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0+
-# Makefile.am
 
 ACLOCAL_AMFLAGS = -I m4
 
fuse/Makefile.am +0 -1
index e7757bc..962b467 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0+
-# Makefile.am
 
 AUTOMAKE_OPTIONS = foreign
 bin_PROGRAMS     = erofsfuse
fuse/dir.c +0 -2
index e16fda1..9d95ec6 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/fuse/dir.c
- *
  * Created by Li Guifu <[email protected]>
  */
 #include <fuse.h>
fuse/main.c +0 -2
index 5552480..34a9b7a 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/fuse/main.c
- *
  * Created by Li Guifu <[email protected]>
  */
 #include <stdlib.h>
include/erofs/block_list.h +0 -2
index 7756d8a..5127b23 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/include/erofs/block_list.h
- *
  * Copyright (C), 2021, Coolpad Group Limited.
  * Created by Yue Hu <[email protected]>
  */
include/erofs/cache.h +0 -2
index 611ca5b..a249d30 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/cache.h
- *
  * Copyright (C) 2018 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Miao Xie <[email protected]>
include/erofs/compress.h +0 -2
index d234e8b..47fd489 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/compress.h
- *
  * Copyright (C) 2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
include/erofs/config.h +0 -2
index 8124f3b..896049b 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/config.h
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/decompress.h +0 -2
index beaac35..0ba2b08 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/decompress.h
- *
  * Copyright (C), 2008-2020, OPPO Mobile Comm Corp., Ltd.
  * Created by Huang Jianan <[email protected]>
  */
include/erofs/defs.h +0 -2
index 5410685..6e0a777 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/defs.h
- *
  * Copyright (C) 2018 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/err.h +0 -2
index da3b681..2ff77a4 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/err.h
- *
  * Copyright (C) 2018 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/exclude.h +0 -2
index 88c55d7..98217e4 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/exclude.h
- *
  * Created by Li Guifu <[email protected]>
  */
 #ifndef __EROFS_EXCLUDE_H
include/erofs/hashtable.h +0 -2
index 7e47189..a71cb00 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * erofs-utils/include/erofs/hashtable.h
- *
  * Original code taken from 'linux/include/linux/hash{,table}.h'
  */
 #ifndef __EROFS_HASHTABLE_H
include/erofs/inode.h +0 -2
index 5a7f5f1..a736762 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/inode.h
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/internal.h +0 -2
index 5583861..7dc5ff0 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/internal.h
- *
  * Copyright (C) 2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
include/erofs/io.h +0 -2
index 5574245..20b25d0 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/io.h
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/list.h +0 -2
index 3572726..d2bc704 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/list.h
- *
  * Copyright (C) 2018 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/print.h +0 -2
index 6b79074..9c08a50 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/print.h
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/trace.h +0 -2
index 5a12da7..5412ded 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/trace.h
- *
  * Copyright (C) 2020 Gao Xiang <[email protected]>
  */
 #ifndef __EROFS_TRACE_H
include/erofs/xattr.h +0 -2
index 197fe25..5086b54 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/include/erofs/xattr.h
- *
  * Originally contributed by an anonymous person,
  * heavily changed by Li Guifu <[email protected]>
  *                and Gao Xiang <[email protected]>
include/erofs_fs.h +0 -1
index 18fc182..f9cdd71 100644
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0-only OR Apache-2.0 */
 /*
- * erofs-utils/include/erofs_fs.h
  * EROFS (Enhanced ROM File System) on-disk format definition
  *
  * Copyright (C) 2017-2018 HUAWEI, Inc.
lib/Makefile.am +0 -1
index b12e2c1..87e6411 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0+
-# Makefile.am
 
 noinst_LTLIBRARIES = liberofs.la
 noinst_HEADERS = $(top_srcdir)/include/erofs_fs.h \
lib/block_list.c +0 -2
index 3be0992..73c1bde 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/block_list.c
- *
  * Copyright (C), 2021, Coolpad Group Limited.
  * Created by Yue Hu <[email protected]>
  */
lib/cache.c +0 -2
index 340dcdd..0a1c0cf 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/cache.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Miao Xie <[email protected]>
lib/compress.c +0 -2
index a8ebbc1..2b12d67 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/compress.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Miao Xie <[email protected]>
lib/compressor.c +0 -2
index 8836e0c..846a836 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/compressor.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
lib/compressor.h +0 -2
index b2471c4..132bd65 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/lib/compressor.h
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
lib/compressor_lz4.c +0 -2
index 292d0f2..ce8c472 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/compressor-lz4.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
lib/compressor_lz4hc.c +0 -2
index 14c3a71..e345f70 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/compressor-lz4hc.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
lib/config.c +0 -2
index 99fcf49..aa328c4 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/config.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
lib/data.c +0 -2
index 42b4904..32d4c00 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/data.c
- *
  * Copyright (C) 2020 Gao Xiang <[email protected]>
  * Compression support by Huang Jianan <[email protected]>
  */
lib/decompress.c +0 -2
index 490c4bc..2ee1439 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/decompress.c
- *
  * Copyright (C), 2008-2020, OPPO Mobile Comm Corp., Ltd.
  * Created by Huang Jianan <[email protected]>
  */
lib/exclude.c +0 -2
index 73b3720..e9e8b9b 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/exclude.c
- *
  * Created by Li Guifu <[email protected]>
  */
 #include <string.h>
lib/inode.c +0 -2
index 6871d2b..62047d3 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/inode.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
lib/io.c +0 -2
index 6067041..b053137 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/io.c
- *
  * Copyright (C) 2018 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
lib/namei.c +0 -2
index b572d17..f4094a1 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/namei.c
- *
  * Created by Li Guifu <[email protected]>
  */
 #include <sys/types.h>
lib/super.c +0 -2
index 11405ec..c4a67f3 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/super.c
- *
  * Created by Li Guifu <[email protected]>
  */
 #include <string.h>
lib/xattr.c +0 -2
index aff3d67..39d4a96 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/xattr.c
- *
  * Originally contributed by an anonymous person,
  * heavily changed by Li Guifu <[email protected]>
  *                and Gao Xiang <[email protected]>
lib/zmap.c +0 -2
index 1084faa..fdc84af 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/zmap.c
- *
  * (a large amount of code was adapted from Linux kernel. )
  *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
man/Makefile.am +0 -1
index 0df947b..d62d6e2 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0+
-# Makefile.am
 
 dist_man_MANS = mkfs.erofs.1
 
mkfs/Makefile.am +0 -1
index 8b8e051..bcef7e1 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0+
-# Makefile.am
 
 AUTOMAKE_OPTIONS = foreign
 bin_PROGRAMS     = mkfs.erofs
mkfs/main.c +0 -2
index 89f2310..debb754 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * mkfs/main.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
Signature · 1 line
2.25.1
#3 lore raw

PATCH 2/5 erofs-utils: fix SPDX comment style

In reply to Huang Jianan

From: Huang Jianan <[email protected]>

---
 fuse/macosx.h              | 1 +
 include/erofs/block_list.h | 2 +-
 include/erofs/xattr.h      | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
fuse/macosx.h +1 -0
index 372eba6..81ac47f 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 #ifdef __APPLE__
 #undef LIST_HEAD
 #endif
include/erofs/block_list.h +1 -1
index 5127b23..fca476a 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright (C), 2021, Coolpad Group Limited.
  * Created by Yue Hu <[email protected]>
include/erofs/xattr.h +1 -1
index 5086b54..f0c4c26 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Originally contributed by an anonymous person,
  * heavily changed by Li Guifu <[email protected]>
Signature · 1 line
2.25.1
#5 lore raw

PATCH 3/5 erofs-utils: fix general style problem

In reply to Huang Jianan

From: Huang Jianan <[email protected]>

---
 fuse/main.c                | 5 +----
 include/erofs/block_list.h | 4 ++--
 lib/block_list.c           | 5 +----
 lib/compress.c             | 9 ++++-----
 lib/compressor.c           | 2 +-
 lib/namei.c                | 3 ++-
 lib/xattr.c                | 2 +-
 mkfs/main.c                | 2 +-
 8 files changed, 13 insertions(+), 19 deletions(-)
fuse/main.c +1 -4
index 34a9b7a..197943a 100644
@@ -109,16 +109,13 @@ static struct options {
 	bool odebug;
 } fusecfg;
 
-#define OPTION(t, p)                           \
-    { t, offsetof(struct options, p), 1 }
+#define OPTION(t, p) { t, offsetof(struct options, p), 1 }
 static const struct fuse_opt option_spec[] = {
 	OPTION("--dbglevel=%u", debug_lvl),
 	OPTION("--help", show_help),
 	FUSE_OPT_END
 };
 
-#define OPTION(t, p)    { t, offsetof(struct options, p), 1 }
-
 static void usage(void)
 {
 	struct fuse_args args = FUSE_ARGS_INIT(0, NULL);
include/erofs/block_list.h +2 -2
index fca476a..dcc0e50 100644
@@ -18,8 +18,8 @@ void erofs_droid_blocklist_write_tail_end(struct erofs_inode *inode,
 #else
 static inline void erofs_droid_blocklist_write(struct erofs_inode *inode,
 				 erofs_blk_t blk_start, erofs_blk_t nblocks) {}
-static inline
-void erofs_droid_blocklist_write_tail_end(struct erofs_inode *inode,
+static inline void
+erofs_droid_blocklist_write_tail_end(struct erofs_inode *inode,
 					  erofs_blk_t blkaddr) {}
 #endif
 #endif
lib/block_list.c +1 -4
index 73c1bde..15bb5cf 100644
@@ -11,13 +11,10 @@
 #define pr_fmt(fmt) "EROFS block_list: " FUNC_LINE_FMT fmt "\n"
 #include "erofs/print.h"
 
-static FILE *block_list_fp = NULL;
+static FILE *block_list_fp;
 
 int erofs_droid_blocklist_fopen(void)
 {
-	if (block_list_fp)
-		return 0;
-
 	block_list_fp = fopen(cfg.block_list_file, "w");
 
 	if (!block_list_fp)
lib/compress.c +4 -5
index 2b12d67..0530765 100644
@@ -292,13 +292,12 @@ static void *write_compacted_indexes(u8 *out,
 	bool update_blkaddr;
 	erofs_blk_t blkaddr;
 
-	if (destsize == 4) {
+	if (destsize == 4)
 		vcnt = 2;
-	} else if (destsize == 2 && logical_clusterbits == 12) {
+	else if (destsize == 2 && logical_clusterbits == 12)
 		vcnt = 16;
-	} else {
+	else
 		return ERR_PTR(-EINVAL);
-	}
 	encodebits = (vcnt * destsize * 8 - 32) / vcnt;
 	blkaddr = *blkaddr_ret;
 	update_blkaddr = erofs_sb_has_big_pcluster();
@@ -467,8 +466,8 @@ int erofs_write_compressed_file(struct erofs_inode *inode)
 	erofs_blk_t blkaddr, compressed_blocks;
 	unsigned int legacymetasize;
 	int ret, fd;
-
 	u8 *compressmeta = malloc(vle_compressmeta_capacity(inode->i_size));
+
 	if (!compressmeta)
 		return -ENOMEM;
 
lib/compressor.c +1 -1
index 846a836..6bc5c4c 100644
@@ -26,7 +26,7 @@ int erofs_compress_destsize(struct erofs_compress *c,
 			    void *dst,
 			    unsigned int dstsize)
 {
-	unsigned uncompressed_size;
+	unsigned int uncompressed_size;
 	int ret;
 
 	DBG_BUGON(!c->alg);
lib/namei.c +2 -1
index f4094a1..54c368a 100644
@@ -243,7 +243,8 @@ static int link_path_walk(const char *name, struct nameidata *nd)
 
 		name = p;
 		/* Skip until no more slashes. */
-		for (name = p; *name == '/'; ++name);
+		for (name = p; *name == '/'; ++name)
+			;
 	}
 	return 0;
 }
lib/xattr.c +1 -1
index 39d4a96..821e6c9 100644
@@ -215,7 +215,7 @@ static struct xattr_item *erofs_get_selabel_xattr(const char *srcpath,
 				       erofs_fspath(srcpath));
 		else
 #endif
-		ret = asprintf(&fspath, "/%s", erofs_fspath(srcpath));
+			ret = asprintf(&fspath, "/%s", erofs_fspath(srcpath));
 		if (ret <= 0)
 			return ERR_PTR(-ENOMEM);
 
mkfs/main.c +1 -1
index debb754..40ca94f 100644
@@ -174,7 +174,7 @@ static int mkfs_parse_options_cfg(int argc, char *argv[])
 	char *endptr;
 	int opt, i;
 
-	while((opt = getopt_long(argc, argv, "d:x:z:E:T:U:C:",
+	while ((opt = getopt_long(argc, argv, "d:x:z:E:T:U:C:",
 				 long_options, NULL)) != -1) {
 		switch (opt) {
 		case 'z':
Signature · 1 line
2.25.1
#7 lore raw

PATCH 4/5 erofs-utils: remove unnecessary codes and comments

In reply to Huang Jianan

From: Huang Jianan <[email protected]>

---
 lib/inode.c | 4 ----
 lib/zmap.c  | 1 -
 2 files changed, 5 deletions(-)
lib/inode.c +0 -4
index 62047d3..f001016 100644
@@ -677,11 +677,7 @@ out:
 		 * Don't leave DATA buffers which were written in the global
 		 * buffer list. It will make balloc() slowly.
 		 */
-#if 0
-		bh->op = &erofs_drop_directly_bhops;
-#else
 		erofs_bdrop(bh, false);
-#endif
 		inode->bh_data = NULL;
 	}
 	return 0;
lib/zmap.c +0 -1
index fdc84af..88da515 100644
@@ -423,7 +423,6 @@ static int z_erofs_get_extent_compressedlen(struct z_erofs_maprecorder *m,
 			goto err_bonus_cblkcnt;
 		if (m->compressedlcs)
 			break;
-		/* fallthrough */
 	default:
 		erofs_err("cannot found CBLKCNT @ lcn %lu of nid %llu",
 			  lcn, vi->nid | 0ULL);
Signature · 1 line
2.25.1
#8 lore raw

Re: [PATCH 4/5] erofs-utils: remove unnecessary codes and comments

Quoted 29 lines · Huang Jianan

From: Huang Jianan <[email protected]>

---
 lib/inode.c | 4 ----
 lib/zmap.c  | 1 -
 2 files changed, 5 deletions(-)
lib/inode.c +0 -4
index 62047d3..f001016 100644
@@ -677,11 +677,7 @@ out:
 		 * Don't leave DATA buffers which were written in the global
 		 * buffer list. It will make balloc() slowly.
 		 */
-#if 0
-		bh->op = &erofs_drop_directly_bhops;
-#else
 		erofs_bdrop(bh, false);
-#endif
 		inode->bh_data = NULL;
 	}
 	return 0;
lib/zmap.c +0 -0
index fdc84af..88da515 100644

lib/zmap.c static int z_erofs_get_extent_compressedlen(struct z_erofs_maprecorder *m, · line 426

Quoted 4 lines
lib/zmap.c +0 -1
@@ -423,7 +423,6 @@ static int z_erofs_get_extent_compressedlen(struct z_erofs_maprecorder *m,
 			goto err_bonus_cblkcnt;
 		if (m->compressedlcs)
 			break;
-		/* fallthrough */

I don't think this should be removed. On the kernel side, we use "fallthrough;" instead.

Could we add all the missing "/* fallthrough */"?

Thanks,
Gao Xiang

Quoted 5 lines
lib/zmap.c +0 -0
 	default:
 		erofs_err("cannot found CBLKCNT @ lcn %lu of nid %llu",
 			  lcn, vi->nid | 0ULL);
Signature · 1 line
2.25.1
#9 lore raw

PATCH 5/5 erofs-utils: fix print style

In reply to Huang Jianan

From: Huang Jianan <[email protected]>

Fix warning "quoted string split across lines".

---
 lib/inode.c | 3 +--
 lib/io.c    | 3 +--
 lib/zmap.c  | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)
lib/inode.c +1 -2
index f001016..76f5fb3 100644
@@ -741,8 +741,7 @@ int erofs_droid_inode_fsconfig(struct erofs_inode *inode,
 			  cfg.target_out_path,
 			  &uid, &gid, &mode, &inode->capabilities);
 
-	erofs_dbg("/%s -> mode = 0x%x, uid = 0x%x, gid = 0x%x, "
-		  "capabilities = 0x%" PRIx64 "\n",
+	erofs_dbg("/%s -> mode = 0x%x, uid = 0x%x, gid = 0x%x, capabilities = 0x%" PRIx64 "\n",
 		  fspath, mode, uid, gid, inode->capabilities);
 
 	if (decorated)
lib/io.c +1 -2
index b053137..620cb9c 100644
@@ -242,8 +242,7 @@ int dev_read(void *buf, u64 offset, size_t len)
 	}
 	if (offset >= erofs_devsz || len > erofs_devsz ||
 	    offset > erofs_devsz - len) {
-		erofs_err("read posion[%" PRIu64 ", %zd] is too large beyond"
-			  "the end of device(%" PRIu64 ").",
+		erofs_err("read posion[%" PRIu64 ", %zd] is too large beyond the end of device(%" PRIu64 ").",
 			  offset, len, erofs_devsz);
 		return -EINVAL;
 	}
lib/zmap.c +1 -2
index 88da515..e4306ce 100644
@@ -57,8 +57,7 @@ static int z_erofs_fill_inode_lazy(struct erofs_inode *vi)
 	if (vi->datalayout == EROFS_INODE_FLAT_COMPRESSION &&
 	    !(vi->z_advise & Z_EROFS_ADVISE_BIG_PCLUSTER_1) ^
 	    !(vi->z_advise & Z_EROFS_ADVISE_BIG_PCLUSTER_2)) {
-		erofs_err(
-"big pcluster head1/2 of compact indexes should be consistent for nid %llu",
+		erofs_err("big pcluster head1/2 of compact indexes should be consistent for nid %llu",
 			  vi->nid * 1ULL);
 		return -EFSCORRUPTED;
 	}
Signature · 1 line
2.25.1
Reviewed-by on v1 5/5
#10 lore raw

Re: [PATCH 5/5] erofs-utils: fix print style

Quoted 5 lines · Huang Jianan

From: Huang Jianan <[email protected]>

Fix warning "quoted string split across lines".

Thanks,
Gao Xiang

Quoted 50 lines
---
 lib/inode.c | 3 +--
 lib/io.c    | 3 +--
 lib/zmap.c  | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)
lib/inode.c +1 -2
index f001016..76f5fb3 100644
@@ -741,8 +741,7 @@ int erofs_droid_inode_fsconfig(struct erofs_inode *inode,
 			  cfg.target_out_path,
 			  &uid, &gid, &mode, &inode->capabilities);
 
-	erofs_dbg("/%s -> mode = 0x%x, uid = 0x%x, gid = 0x%x, "
-		  "capabilities = 0x%" PRIx64 "\n",
+	erofs_dbg("/%s -> mode = 0x%x, uid = 0x%x, gid = 0x%x, capabilities = 0x%" PRIx64 "\n",
 		  fspath, mode, uid, gid, inode->capabilities);
 
 	if (decorated)
lib/io.c +1 -2
index b053137..620cb9c 100644
@@ -242,8 +242,7 @@ int dev_read(void *buf, u64 offset, size_t len)
 	}
 	if (offset >= erofs_devsz || len > erofs_devsz ||
 	    offset > erofs_devsz - len) {
-		erofs_err("read posion[%" PRIu64 ", %zd] is too large beyond"
-			  "the end of device(%" PRIu64 ").",
+		erofs_err("read posion[%" PRIu64 ", %zd] is too large beyond the end of device(%" PRIu64 ").",
 			  offset, len, erofs_devsz);
 		return -EINVAL;
 	}
lib/zmap.c +1 -2
index 88da515..e4306ce 100644
@@ -57,8 +57,7 @@ static int z_erofs_fill_inode_lazy(struct erofs_inode *vi)
 	if (vi->datalayout == EROFS_INODE_FLAT_COMPRESSION &&
 	    !(vi->z_advise & Z_EROFS_ADVISE_BIG_PCLUSTER_1) ^
 	    !(vi->z_advise & Z_EROFS_ADVISE_BIG_PCLUSTER_2)) {
-		erofs_err(
-"big pcluster head1/2 of compact indexes should be consistent for nid %llu",
+		erofs_err("big pcluster head1/2 of compact indexes should be consistent for nid %llu",
 			  vi->nid * 1ULL);
 		return -EFSCORRUPTED;
 	}
Signature · 1 line
2.25.1
#11 lore raw

v2 cover erofs-utils: fix checkpatch.pl complains

In reply to Huang Jianan

From: Huang Jianan <[email protected]>

This patchset fix most of checkpatch.pl complains in erofs-utils, some problems that also exist in the kernel haven't been fixed.

Changes since v1:
- remove trailing newline (Gao Xiang);
- add missing /* fallthrough */ (Gao Xiang);

Huang Jianan (6):
erofs-utils: clean up file headers & footers
erofs-utils: fix SPDX comment style
erofs-utils: fix general style problem
erofs-utils: remove unnecessary codes
erofs-utils: fix print style
erofs-utils: add missing /* fallthrough */

 AUTHORS                    |  1 -
 ChangeLog                  |  1 -
 Makefile.am                |  2 --
 README                     |  1 -
 autogen.sh                 |  1 -
 configure.ac               |  1 -
 fuse/Makefile.am           |  2 --
 fuse/dir.c                 |  3 ---
 fuse/macosx.h              |  1 +
 fuse/main.c                |  8 +-------
 include/erofs/block_list.h |  8 +++-----
 include/erofs/cache.h      |  3 ---
 include/erofs/compress.h   |  3 ---
 include/erofs/config.h     |  3 ---
 include/erofs/decompress.h |  2 --
 include/erofs/defs.h       |  2 --
 include/erofs/err.h        |  3 ---
 include/erofs/exclude.h    |  3 ---
 include/erofs/hashtable.h  |  2 --
 include/erofs/inode.h      |  2 --
 include/erofs/internal.h   |  2 --
 include/erofs/io.h         |  3 ---
 include/erofs/list.h       |  2 --
 include/erofs/print.h      |  4 ----
 include/erofs/trace.h      |  3 ---
 include/erofs/xattr.h      |  4 +---
 include/erofs_fs.h         |  2 --
 lib/Makefile.am            |  2 --
 lib/block_list.c           |  7 +------
 lib/cache.c                |  3 ---
 lib/compress.c             | 12 ++++--------
 lib/compressor.c           |  5 +----
 lib/compressor.h           |  3 ---
 lib/compressor_lz4.c       |  3 ---
 lib/compressor_lz4hc.c     |  3 ---
 lib/config.c               |  3 ---
 lib/data.c                 |  3 ---
 lib/decompress.c           |  2 --
 lib/exclude.c              |  3 ---
 lib/inode.c                | 10 +---------
 lib/io.c                   |  5 +----
 lib/namei.c                |  6 ++----
 lib/super.c                |  3 ---
 lib/xattr.c                |  5 +----
 lib/zmap.c                 |  8 ++++----
 man/Makefile.am            |  1 -
 man/mkfs.erofs.1           |  1 -
 mkfs/Makefile.am           |  2 --
 mkfs/main.c                |  4 +---
 49 files changed, 22 insertions(+), 144 deletions(-)
Signature · 1 line
2.25.1
#12 lore raw

PATCH v2 1/6 erofs-utils: clean up file headers & footers

From: Huang Jianan <[email protected]>

- Remove filename in the file since it's generally not useful.
- Get rid of all unnecessary trailing newline.

---
 AUTHORS                    | 1 -
 ChangeLog                  | 1 -
 Makefile.am                | 2 --
 README                     | 1 -
 autogen.sh                 | 1 -
 configure.ac               | 1 -
 fuse/Makefile.am           | 2 --
 fuse/dir.c                 | 3 ---
 fuse/main.c                | 3 ---
 include/erofs/block_list.h | 2 --
 include/erofs/cache.h      | 3 ---
 include/erofs/compress.h   | 3 ---
 include/erofs/config.h     | 3 ---
 include/erofs/decompress.h | 2 --
 include/erofs/defs.h       | 2 --
 include/erofs/err.h        | 3 ---
 include/erofs/exclude.h    | 3 ---
 include/erofs/hashtable.h  | 2 --
 include/erofs/inode.h      | 2 --
 include/erofs/internal.h   | 2 --
 include/erofs/io.h         | 3 ---
 include/erofs/list.h       | 2 --
 include/erofs/print.h      | 4 ----
 include/erofs/trace.h      | 3 ---
 include/erofs/xattr.h      | 2 --
 include/erofs_fs.h         | 2 --
 lib/Makefile.am            | 2 --
 lib/block_list.c           | 2 --
 lib/cache.c                | 3 ---
 lib/compress.c             | 3 ---
 lib/compressor.c           | 3 ---
 lib/compressor.h           | 3 ---
 lib/compressor_lz4.c       | 3 ---
 lib/compressor_lz4hc.c     | 3 ---
 lib/config.c               | 3 ---
 lib/data.c                 | 3 ---
 lib/decompress.c           | 2 --
 lib/exclude.c              | 3 ---
 lib/inode.c                | 3 ---
 lib/io.c                   | 2 --
 lib/namei.c                | 3 ---
 lib/super.c                | 3 ---
 lib/xattr.c                | 3 ---
 lib/zmap.c                 | 2 --
 man/Makefile.am            | 1 -
 man/mkfs.erofs.1           | 1 -
 mkfs/Makefile.am           | 2 --
 mkfs/main.c                | 2 --
 48 files changed, 113 deletions(-)
AUTHORS +0 -1
index 3487d44..dacbdda 100644
@@ -6,4 +6,3 @@ R: Gao Xiang <[email protected]>
 R: Chao Yu <[email protected]>
 S: Maintained
 L: [email protected]
-
ChangeLog +0 -1
index 6637bc3..4c0c941 100644
@@ -58,4 +58,3 @@ erofs-utils (1.0-1) unstable; urgency=low
    - (mkfs.erofs) Posix ACL support;
 
  -- Gao Xiang <[email protected]>  Thu, 24 Oct 2019 00:00:00 +0800
-
Makefile.am +0 -2
index b804aa9..20f0f7d 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0+
-# Makefile.am
 
 ACLOCAL_AMFLAGS = -I m4
 
@@ -7,4 +6,3 @@ SUBDIRS = man lib mkfs
 if ENABLE_FUSE
 SUBDIRS += fuse
 endif
-
README +0 -1
index af9cdf1..7b641f7 100644
@@ -230,4 +230,3 @@ Comments
     https://github.com/lz4/lz4/issues/783
 
     which is also resolved in lz4-1.9.3.
-
autogen.sh +0 -1
index 6816b11..fd81db4 100755
@@ -7,4 +7,3 @@ autoconf && \
 case `uname` in Darwin*) glibtoolize --copy ;; \
   *) libtoolize --copy ;; esac && \
 automake -a -c
-
configure.ac +0 -1
index 3510609..a749db0 100644
@@ -297,4 +297,3 @@ AC_CONFIG_FILES([Makefile
 		 mkfs/Makefile
 		 fuse/Makefile])
 AC_OUTPUT
-
fuse/Makefile.am +0 -2
index e7757bc..6893a97 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0+
-# Makefile.am
 
 AUTOMAKE_OPTIONS = foreign
 bin_PROGRAMS     = erofsfuse
@@ -7,4 +6,3 @@ erofsfuse_SOURCES = dir.c main.c
 erofsfuse_CFLAGS = -Wall -Werror -I$(top_srcdir)/include
 erofsfuse_CFLAGS += -DFUSE_USE_VERSION=26 ${libfuse_CFLAGS} ${libselinux_CFLAGS}
 erofsfuse_LDADD = $(top_builddir)/lib/liberofs.la ${libfuse_LIBS} ${liblz4_LIBS} ${libselinux_LIBS}
-
fuse/dir.c +0 -3
index e16fda1..bc8735b 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/fuse/dir.c
- *
  * Created by Li Guifu <[email protected]>
  */
 #include <fuse.h>
@@ -100,4 +98,3 @@ int erofsfuse_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
 	}
 	return 0;
 }
-
fuse/main.c +0 -3
index 5552480..fca4d7f 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/fuse/main.c
- *
  * Created by Li Guifu <[email protected]>
  */
 #include <stdlib.h>
@@ -249,4 +247,3 @@ err:
 	erofs_exit_configure();
 	return ret ? EXIT_FAILURE : EXIT_SUCCESS;
 }
-
include/erofs/block_list.h +0 -2
index 7756d8a..5127b23 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/include/erofs/block_list.h
- *
  * Copyright (C), 2021, Coolpad Group Limited.
  * Created by Yue Hu <[email protected]>
  */
include/erofs/cache.h +0 -3
index 611ca5b..e324d92 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/cache.h
- *
  * Copyright (C) 2018 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Miao Xie <[email protected]>
@@ -102,4 +100,3 @@ bool erofs_bflush(struct erofs_buffer_block *bb);
 void erofs_bdrop(struct erofs_buffer_head *bh, bool tryrevoke);
 
 #endif
-
include/erofs/compress.h +0 -3
index d234e8b..4434aaa 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/compress.h
- *
  * Copyright (C) 2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
@@ -24,4 +22,3 @@ int z_erofs_compress_exit(void);
 const char *z_erofs_list_available_compressors(unsigned int i);
 
 #endif
-
include/erofs/config.h +0 -3
index 8124f3b..95fc23e 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/config.h
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
@@ -89,4 +87,3 @@ static inline int erofs_selabel_open(const char *file_contexts)
 #endif
 
 #endif
-
include/erofs/decompress.h +0 -2
index beaac35..0ba2b08 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/decompress.h
- *
  * Copyright (C), 2008-2020, OPPO Mobile Comm Corp., Ltd.
  * Created by Huang Jianan <[email protected]>
  */
include/erofs/defs.h +0 -2
index 5410685..6e0a777 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/defs.h
- *
  * Copyright (C) 2018 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/err.h +0 -3
index da3b681..a33bdd1 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/err.h
- *
  * Copyright (C) 2018 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
@@ -31,4 +29,3 @@ static inline long PTR_ERR(const void *ptr)
 }
 
 #endif
-
include/erofs/exclude.h +0 -3
index 88c55d7..6930f2b 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/exclude.h
- *
  * Created by Li Guifu <[email protected]>
  */
 #ifndef __EROFS_EXCLUDE_H
@@ -24,4 +22,3 @@ int erofs_parse_exclude_path(const char *args, bool is_regex);
 struct erofs_exclude_rule *erofs_is_exclude_path(const char *dir,
 						 const char *name);
 #endif
-
include/erofs/hashtable.h +0 -2
index 7e47189..a71cb00 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * erofs-utils/include/erofs/hashtable.h
- *
  * Original code taken from 'linux/include/linux/hash{,table}.h'
  */
 #ifndef __EROFS_HASHTABLE_H
include/erofs/inode.h +0 -2
index 5a7f5f1..a736762 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/inode.h
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/internal.h +0 -2
index 5583861..7dc5ff0 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/internal.h
- *
  * Copyright (C) 2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
include/erofs/io.h +0 -3
index 5574245..0763baf 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/io.h
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
@@ -41,4 +39,3 @@ static inline int blk_read(void *buf, erofs_blk_t start,
 }
 
 #endif
-
include/erofs/list.h +0 -2
index 3572726..d2bc704 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/list.h
- *
  * Copyright (C) 2018 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
include/erofs/print.h +0 -4
index 6b79074..57b6607 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/print.h
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
@@ -71,6 +69,4 @@ enum {
 
 #define erofs_dump(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
 
-
 #endif
-
include/erofs/trace.h +0 -3
index 5a12da7..d70d236 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/include/erofs/trace.h
- *
  * Copyright (C) 2020 Gao Xiang <[email protected]>
  */
 #ifndef __EROFS_TRACE_H
@@ -11,4 +9,3 @@
 #define trace_erofs_map_blocks_flatmode_exit(inode, map, flags, ret) ((void)0)
 
 #endif
-
include/erofs/xattr.h +0 -2
index 197fe25..5086b54 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/include/erofs/xattr.h
- *
  * Originally contributed by an anonymous person,
  * heavily changed by Li Guifu <[email protected]>
  *                and Gao Xiang <[email protected]>
include/erofs_fs.h +0 -2
index 18fc182..48934bb 100644
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0-only OR Apache-2.0 */
 /*
- * erofs-utils/include/erofs_fs.h
  * EROFS (Enhanced ROM File System) on-disk format definition
  *
  * Copyright (C) 2017-2018 HUAWEI, Inc.
@@ -360,4 +359,3 @@ static inline void erofs_check_ondisk_layout_definitions(void)
 }
 
 #endif
-
lib/Makefile.am +0 -2
index b12e2c1..b5127c4 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0+
-# Makefile.am
 
 noinst_LTLIBRARIES = liberofs.la
 noinst_HEADERS = $(top_srcdir)/include/erofs_fs.h \
@@ -30,4 +29,3 @@ if ENABLE_LZ4HC
 liberofs_la_SOURCES += compressor_lz4hc.c
 endif
 endif
-
lib/block_list.c +0 -2
index 3be0992..73c1bde 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/block_list.c
- *
  * Copyright (C), 2021, Coolpad Group Limited.
  * Created by Yue Hu <[email protected]>
  */
lib/cache.c +0 -3
index 340dcdd..8016e38 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/cache.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Miao Xie <[email protected]>
@@ -442,4 +440,3 @@ void erofs_bdrop(struct erofs_buffer_head *bh, bool tryrevoke)
 	if (rollback)
 		tail_blkaddr = blkaddr;
 }
-
lib/compress.c +0 -3
index a8ebbc1..5ac9427 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/compress.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Miao Xie <[email protected]>
@@ -680,4 +678,3 @@ int z_erofs_compress_exit(void)
 {
 	return erofs_compressor_exit(&compresshandle);
 }
-
lib/compressor.c +0 -3
index 8836e0c..c14fc05 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/compressor.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
@@ -91,4 +89,3 @@ int erofs_compressor_exit(struct erofs_compress *c)
 		return c->alg->exit(c);
 	return 0;
 }
-
lib/compressor.h +0 -3
index b2471c4..151c43d 100644
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- * erofs-utils/lib/compressor.h
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
@@ -53,4 +51,3 @@ int erofs_compressor_init(struct erofs_compress *c, char *alg_name);
 int erofs_compressor_exit(struct erofs_compress *c);
 
 #endif
-
lib/compressor_lz4.c +0 -3
index 292d0f2..f71252e 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/compressor-lz4.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
@@ -48,4 +46,3 @@ struct erofs_compressor erofs_compressor_lz4 = {
 	.exit = compressor_lz4_exit,
 	.compress_destsize = lz4_compress_destsize,
 };
-
lib/compressor_lz4hc.c +0 -3
index 14c3a71..0c912fb 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/compressor-lz4hc.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Gao Xiang <[email protected]>
@@ -61,4 +59,3 @@ struct erofs_compressor erofs_compressor_lz4hc = {
 	.exit = compressor_lz4hc_exit,
 	.compress_destsize = lz4hc_compress_destsize,
 };
-
lib/config.c +0 -3
index 99fcf49..4757dbb 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/config.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
@@ -85,4 +83,3 @@ int erofs_selabel_open(const char *file_contexts)
 	return 0;
 }
 #endif
-
lib/data.c +0 -3
index 42b4904..1a1005a 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/data.c
- *
  * Copyright (C) 2020 Gao Xiang <[email protected]>
  * Compression support by Huang Jianan <[email protected]>
  */
@@ -217,4 +215,3 @@ int erofs_pread(struct erofs_inode *inode, char *buf,
 	}
 	return -EINVAL;
 }
-
lib/decompress.c +0 -2
index 490c4bc..2ee1439 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/decompress.c
- *
  * Copyright (C), 2008-2020, OPPO Mobile Comm Corp., Ltd.
  * Created by Huang Jianan <[email protected]>
  */
lib/exclude.c +0 -3
index 73b3720..2f980a3 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/exclude.c
- *
  * Created by Li Guifu <[email protected]>
  */
 #include <string.h>
@@ -129,4 +127,3 @@ struct erofs_exclude_rule *erofs_is_exclude_path(const char *dir,
 	}
 	return NULL;
 }
-
lib/inode.c +0 -3
index 6871d2b..97ee2c9 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/inode.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
@@ -1100,4 +1098,3 @@ struct erofs_inode *erofs_mkfs_build_tree_from_path(struct erofs_inode *parent,
 
 	return erofs_mkfs_build_tree(inode);
 }
-
lib/io.c +0 -2
index 6067041..b053137 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/io.c
- *
  * Copyright (C) 2018 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
lib/namei.c +0 -3
index b572d17..755a5ad 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/namei.c
- *
  * Created by Li Guifu <[email protected]>
  */
 #include <sys/types.h>
@@ -262,4 +260,3 @@ int erofs_ilookup(const char *path, struct erofs_inode *vi)
 	vi->nid = nd.nid;
 	return erofs_read_inode_from_disk(vi);
 }
-
lib/super.c +0 -3
index 11405ec..0fa69ab 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/super.c
- *
  * Created by Li Guifu <[email protected]>
  */
 #include <string.h>
@@ -71,4 +69,3 @@ int erofs_read_superblock(void)
 	memcpy(&sbi.uuid, dsb->uuid, sizeof(dsb->uuid));
 	return 0;
 }
-
lib/xattr.c +0 -3
index aff3d67..ffc5f7a 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/xattr.c
- *
  * Originally contributed by an anonymous person,
  * heavily changed by Li Guifu <[email protected]>
  *                and Gao Xiang <[email protected]>
@@ -687,4 +685,3 @@ char *erofs_export_xattr_ibody(struct list_head *ixattrs, unsigned int size)
 	DBG_BUGON(p > size);
 	return buf;
 }
-
lib/zmap.c +0 -2
index 1084faa..fdc84af 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * erofs-utils/lib/zmap.c
- *
  * (a large amount of code was adapted from Linux kernel. )
  *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
man/Makefile.am +0 -1
index 0df947b..d62d6e2 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0+
-# Makefile.am
 
 dist_man_MANS = mkfs.erofs.1
 
man/mkfs.erofs.1 +0 -1
index d164fa5..bc0a10b 100644
@@ -99,4 +99,3 @@ This manual page was written by Gao Xiang <[email protected]>.
 git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git.
 .SH SEE ALSO
 .BR mkfs (8).
-
mkfs/Makefile.am +0 -2
index 8b8e051..e488f86 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0+
-# Makefile.am
 
 AUTOMAKE_OPTIONS = foreign
 bin_PROGRAMS     = mkfs.erofs
@@ -7,4 +6,3 @@ AM_CPPFLAGS = ${libuuid_CFLAGS} ${libselinux_CFLAGS}
 mkfs_erofs_SOURCES = main.c
 mkfs_erofs_CFLAGS = -Wall -Werror -I$(top_srcdir)/include
 mkfs_erofs_LDADD = ${libuuid_LIBS} $(top_builddir)/lib/liberofs.la ${libselinux_LIBS} ${liblz4_LIBS}
-
mkfs/main.c +0 -2
index 89f2310..debb754 100644
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * mkfs/main.c
- *
  * Copyright (C) 2018-2019 HUAWEI, Inc.
  *             http://www.huawei.com/
  * Created by Li Guifu <[email protected]>
Signature · 1 line
2.25.1
#14 lore raw

PATCH v2 2/6 erofs-utils: fix SPDX comment style

In reply to Huang Jianan

From: Huang Jianan <[email protected]>

---
 fuse/macosx.h              | 1 +
 include/erofs/block_list.h | 2 +-
 include/erofs/xattr.h      | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
fuse/macosx.h +1 -0
index 372eba6..81ac47f 100644
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 #ifdef __APPLE__
 #undef LIST_HEAD
 #endif
include/erofs/block_list.h +1 -1
index 5127b23..fca476a 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright (C), 2021, Coolpad Group Limited.
  * Created by Yue Hu <[email protected]>
include/erofs/xattr.h +1 -1
index 5086b54..f0c4c26 100644
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Originally contributed by an anonymous person,
  * heavily changed by Li Guifu <[email protected]>
Signature · 1 line
2.25.1
#15 lore raw

PATCH v2 3/6 erofs-utils: fix general style problem

In reply to Huang Jianan

From: Huang Jianan <[email protected]>

---
 include/erofs/block_list.h | 4 ++--
 lib/block_list.c           | 5 +----
 lib/compress.c             | 9 ++++-----
 lib/compressor.c           | 2 +-
 lib/namei.c                | 3 ++-
 lib/xattr.c                | 2 +-
 mkfs/main.c                | 2 +-
 7 files changed, 12 insertions(+), 15 deletions(-)
include/erofs/block_list.h +2 -2
index fca476a..dcc0e50 100644
@@ -18,8 +18,8 @@ void erofs_droid_blocklist_write_tail_end(struct erofs_inode *inode,
 #else
 static inline void erofs_droid_blocklist_write(struct erofs_inode *inode,
 				 erofs_blk_t blk_start, erofs_blk_t nblocks) {}
-static inline
-void erofs_droid_blocklist_write_tail_end(struct erofs_inode *inode,
+static inline void
+erofs_droid_blocklist_write_tail_end(struct erofs_inode *inode,
 					  erofs_blk_t blkaddr) {}
 #endif
 #endif
lib/block_list.c +1 -4
index 73c1bde..15bb5cf 100644
@@ -11,13 +11,10 @@
 #define pr_fmt(fmt) "EROFS block_list: " FUNC_LINE_FMT fmt "\n"
 #include "erofs/print.h"
 
-static FILE *block_list_fp = NULL;
+static FILE *block_list_fp;
 
 int erofs_droid_blocklist_fopen(void)
 {
-	if (block_list_fp)
-		return 0;
-
 	block_list_fp = fopen(cfg.block_list_file, "w");
 
 	if (!block_list_fp)
lib/compress.c +4 -5
index 5ac9427..6df30ea 100644
@@ -292,13 +292,12 @@ static void *write_compacted_indexes(u8 *out,
 	bool update_blkaddr;
 	erofs_blk_t blkaddr;
 
-	if (destsize == 4) {
+	if (destsize == 4)
 		vcnt = 2;
-	} else if (destsize == 2 && logical_clusterbits == 12) {
+	else if (destsize == 2 && logical_clusterbits == 12)
 		vcnt = 16;
-	} else {
+	else
 		return ERR_PTR(-EINVAL);
-	}
 	encodebits = (vcnt * destsize * 8 - 32) / vcnt;
 	blkaddr = *blkaddr_ret;
 	update_blkaddr = erofs_sb_has_big_pcluster();
@@ -467,8 +466,8 @@ int erofs_write_compressed_file(struct erofs_inode *inode)
 	erofs_blk_t blkaddr, compressed_blocks;
 	unsigned int legacymetasize;
 	int ret, fd;
-
 	u8 *compressmeta = malloc(vle_compressmeta_capacity(inode->i_size));
+
 	if (!compressmeta)
 		return -ENOMEM;
 
lib/compressor.c +1 -1
index c14fc05..1f1a33d 100644
@@ -26,7 +26,7 @@ int erofs_compress_destsize(struct erofs_compress *c,
 			    void *dst,
 			    unsigned int dstsize)
 {
-	unsigned uncompressed_size;
+	unsigned int uncompressed_size;
 	int ret;
 
 	DBG_BUGON(!c->alg);
lib/namei.c +2 -1
index 755a5ad..f96e400 100644
@@ -243,7 +243,8 @@ static int link_path_walk(const char *name, struct nameidata *nd)
 
 		name = p;
 		/* Skip until no more slashes. */
-		for (name = p; *name == '/'; ++name);
+		for (name = p; *name == '/'; ++name)
+			;
 	}
 	return 0;
 }
lib/xattr.c +1 -1
index ffc5f7a..196133a 100644
@@ -215,7 +215,7 @@ static struct xattr_item *erofs_get_selabel_xattr(const char *srcpath,
 				       erofs_fspath(srcpath));
 		else
 #endif
-		ret = asprintf(&fspath, "/%s", erofs_fspath(srcpath));
+			ret = asprintf(&fspath, "/%s", erofs_fspath(srcpath));
 		if (ret <= 0)
 			return ERR_PTR(-ENOMEM);
 
mkfs/main.c +1 -1
index debb754..40ca94f 100644
@@ -174,7 +174,7 @@ static int mkfs_parse_options_cfg(int argc, char *argv[])
 	char *endptr;
 	int opt, i;
 
-	while((opt = getopt_long(argc, argv, "d:x:z:E:T:U:C:",
+	while ((opt = getopt_long(argc, argv, "d:x:z:E:T:U:C:",
 				 long_options, NULL)) != -1) {
 		switch (opt) {
 		case 'z':
Signature · 1 line
2.25.1
#16 lore raw

PATCH v2 4/6 erofs-utils: remove unnecessary codes

In reply to Huang Jianan

From: Huang Jianan <[email protected]>

---
 fuse/main.c | 5 +----
 lib/inode.c | 4 ----
 2 files changed, 1 insertion(+), 8 deletions(-)
fuse/main.c +1 -4
index fca4d7f..8137421 100644
@@ -109,16 +109,13 @@ static struct options {
 	bool odebug;
 } fusecfg;
 
-#define OPTION(t, p)                           \
-    { t, offsetof(struct options, p), 1 }
+#define OPTION(t, p) { t, offsetof(struct options, p), 1 }
 static const struct fuse_opt option_spec[] = {
 	OPTION("--dbglevel=%u", debug_lvl),
 	OPTION("--help", show_help),
 	FUSE_OPT_END
 };
 
-#define OPTION(t, p)    { t, offsetof(struct options, p), 1 }
-
 static void usage(void)
 {
 	struct fuse_args args = FUSE_ARGS_INIT(0, NULL);
lib/inode.c +0 -4
index 97ee2c9..61dc802 100644
@@ -677,11 +677,7 @@ out:
 		 * Don't leave DATA buffers which were written in the global
 		 * buffer list. It will make balloc() slowly.
 		 */
-#if 0
-		bh->op = &erofs_drop_directly_bhops;
-#else
 		erofs_bdrop(bh, false);
-#endif
 		inode->bh_data = NULL;
 	}
 	return 0;
Signature · 1 line
2.25.1
#18 lore raw

PATCH v2 5/6 erofs-utils: fix print style

In reply to Huang Jianan

From: Huang Jianan <[email protected]>

Fix warning "quoted string split across lines".

---
 lib/inode.c | 3 +--
 lib/io.c    | 3 +--
 lib/zmap.c  | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)
lib/inode.c +1 -2
index 61dc802..6024e8c 100644
@@ -741,8 +741,7 @@ int erofs_droid_inode_fsconfig(struct erofs_inode *inode,
 			  cfg.target_out_path,
 			  &uid, &gid, &mode, &inode->capabilities);
 
-	erofs_dbg("/%s -> mode = 0x%x, uid = 0x%x, gid = 0x%x, "
-		  "capabilities = 0x%" PRIx64 "\n",
+	erofs_dbg("/%s -> mode = 0x%x, uid = 0x%x, gid = 0x%x, capabilities = 0x%" PRIx64 "\n",
 		  fspath, mode, uid, gid, inode->capabilities);
 
 	if (decorated)
lib/io.c +1 -2
index b053137..620cb9c 100644
@@ -242,8 +242,7 @@ int dev_read(void *buf, u64 offset, size_t len)
 	}
 	if (offset >= erofs_devsz || len > erofs_devsz ||
 	    offset > erofs_devsz - len) {
-		erofs_err("read posion[%" PRIu64 ", %zd] is too large beyond"
-			  "the end of device(%" PRIu64 ").",
+		erofs_err("read posion[%" PRIu64 ", %zd] is too large beyond the end of device(%" PRIu64 ").",
 			  offset, len, erofs_devsz);
 		return -EINVAL;
 	}
lib/zmap.c +1 -2
index fdc84af..ce79601 100644
@@ -57,8 +57,7 @@ static int z_erofs_fill_inode_lazy(struct erofs_inode *vi)
 	if (vi->datalayout == EROFS_INODE_FLAT_COMPRESSION &&
 	    !(vi->z_advise & Z_EROFS_ADVISE_BIG_PCLUSTER_1) ^
 	    !(vi->z_advise & Z_EROFS_ADVISE_BIG_PCLUSTER_2)) {
-		erofs_err(
-"big pcluster head1/2 of compact indexes should be consistent for nid %llu",
+		erofs_err("big pcluster head1/2 of compact indexes should be consistent for nid %llu",
 			  vi->nid * 1ULL);
 		return -EFSCORRUPTED;
 	}
Signature · 1 line
2.25.1
#19 lore raw

PATCH v2 6/6 erofs-utils: add missing /* fallthrough */

In reply to Huang Jianan

From: Huang Jianan <[email protected]>

---
 lib/zmap.c | 3 +++
 1 file changed, 3 insertions(+)
lib/zmap.c +3 -0
index ce79601..458030b 100644
@@ -360,6 +360,7 @@ static int z_erofs_extent_lookback(struct z_erofs_maprecorder *m,
 		return z_erofs_extent_lookback(m, m->delta[0]);
 	case Z_EROFS_VLE_CLUSTER_TYPE_PLAIN:
 		map->m_flags &= ~EROFS_MAP_ZIPPED;
+		/* fallthrough */
 	case Z_EROFS_VLE_CLUSTER_TYPE_HEAD:
 		map->m_la = (lcn << lclusterbits) | m->clusterofs;
 		break;
@@ -479,6 +480,7 @@ int z_erofs_map_blocks_iter(struct erofs_inode *vi,
 	case Z_EROFS_VLE_CLUSTER_TYPE_PLAIN:
 		if (endoff >= m.clusterofs)
 			map->m_flags &= ~EROFS_MAP_ZIPPED;
+		/* fallthrough */
 	case Z_EROFS_VLE_CLUSTER_TYPE_HEAD:
 		if (endoff >= m.clusterofs) {
 			map->m_la = (m.lcn << lclusterbits) | m.clusterofs;
@@ -494,6 +496,7 @@ int z_erofs_map_blocks_iter(struct erofs_inode *vi,
 		end = (m.lcn << lclusterbits) | m.clusterofs;
 		map->m_flags |= EROFS_MAP_FULL_MAPPED;
 		m.delta[0] = 1;
+		/* fallthrough */
 	case Z_EROFS_VLE_CLUSTER_TYPE_NONHEAD:
 		/* get the correspoinding first chunk */
 		err = z_erofs_extent_lookback(&m, m.delta[0]);
Signature · 1 line
2.25.1