Skip to content

Commit 01a678c

Browse files
author
Phillip Lougher
committed
Squashfs: simplify CONFIG_SQUASHFS_LZO handling
Get rid of messy repeated #if(n)def CONFIG_SQUASHFS_LZO code in decompressor.c Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
1 parent 8fcd972 commit 01a678c

3 files changed

Lines changed: 6 additions & 9 deletions

File tree

‎fs/squashfs/decompressor.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static const struct squashfs_decompressor squashfs_lzma_unsupported_comp_ops = {
4040
};
4141

4242
#ifndef CONFIG_SQUASHFS_LZO
43-
static const struct squashfs_decompressor squashfs_lzo_unsupported_comp_ops = {
43+
static const struct squashfs_decompressor squashfs_lzo_comp_ops = {
4444
NULL, NULL, NULL, LZO_COMPRESSION, "lzo", 0
4545
};
4646
#endif
@@ -57,13 +57,9 @@ static const struct squashfs_decompressor squashfs_unknown_comp_ops = {
5757

5858
static const struct squashfs_decompressor *decompressor[] = {
5959
&squashfs_zlib_comp_ops,
60-
&squashfs_lzma_unsupported_comp_ops,
61-
#ifdef CONFIG_SQUASHFS_LZO
6260
&squashfs_lzo_comp_ops,
63-
#else
64-
&squashfs_lzo_unsupported_comp_ops,
65-
#endif
6661
&squashfs_xz_comp_ops,
62+
&squashfs_lzma_unsupported_comp_ops,
6763
&squashfs_unknown_comp_ops
6864
};
6965

‎fs/squashfs/decompressor.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,8 @@ static inline int squashfs_decompress(struct squashfs_sb_info *msblk,
5757
extern const struct squashfs_decompressor squashfs_xz_comp_ops;
5858
#endif
5959

60+
#ifdef CONFIG_SQUASHFS_LZO
61+
extern const struct squashfs_decompressor squashfs_lzo_comp_ops;
62+
#endif
63+
6064
#endif

‎fs/squashfs/squashfs.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,3 @@ extern const struct xattr_handler *squashfs_xattr_handlers[];
9999

100100
/* zlib_wrapper.c */
101101
extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
102-
103-
/* lzo_wrapper.c */
104-
extern const struct squashfs_decompressor squashfs_lzo_comp_ops;

0 commit comments

Comments
 (0)