Skip to contentSkip to conversation

Squashfs: simplify CONFIG_SQUASHFS_LZO handling

PATCH In review Phillip Lougher 1 participant 1 message Jan 6, 2011

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

PATCH 5/5 Squashfs: simplify CONFIG_SQUASHFS_LZO handling

Get rid of messy repeated #if(n)def CONFIG_SQUASHFS_LZO code in decompressor.c

---
 fs/squashfs/decompressor.c |    8 ++------
 fs/squashfs/decompressor.h |    5 +++++
 fs/squashfs/squashfs.h     |    3 ---
 3 files changed, 7 insertions(+), 9 deletions(-)
fs/squashfs/decompressor.c +2 -6
index d83e184..1700065 100644
@@ -40,7 +40,7 @@ static const struct squashfs_decompressor squashfs_lzma_unsupported_comp_ops = {
 };
 
 #ifndef CONFIG_SQUASHFS_LZO
-static const struct squashfs_decompressor squashfs_lzo_unsupported_comp_ops = {
+static const struct squashfs_decompressor squashfs_lzo_comp_ops = {
 	NULL, NULL, NULL, LZO_COMPRESSION, "lzo", 0
 };
 #endif
@@ -51,12 +51,8 @@ static const struct squashfs_decompressor squashfs_unknown_comp_ops = {
 
 static const struct squashfs_decompressor *decompressor[] = {
 	&squashfs_zlib_comp_ops,
-	&squashfs_lzma_unsupported_comp_ops,
-#ifdef CONFIG_SQUASHFS_LZO
 	&squashfs_lzo_comp_ops,
-#else
-	&squashfs_lzo_unsupported_comp_ops,
-#endif
+	&squashfs_lzma_unsupported_comp_ops,
 	&squashfs_unknown_comp_ops
 };
 
fs/squashfs/decompressor.h +5 -0
index 7425f80..805bd0e 100644
@@ -52,4 +52,9 @@ static inline int squashfs_decompress(struct squashfs_sb_info *msblk,
 	return msblk->decompressor->decompress(msblk, buffer, bh, b, offset,
 		length, srclength, pages);
 }
+
+#ifdef CONFIG_SQUASHFS_LZO
+extern const struct squashfs_decompressor squashfs_lzo_comp_ops;
+#endif
+
 #endif
fs/squashfs/squashfs.h +0 -3
index 18f187f..ba729d8 100644
@@ -99,6 +99,3 @@ extern const struct xattr_handler *squashfs_xattr_handlers[];
 
 /* zlib_wrapper.c */
 extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
-
-/* lzo_wrapper.c */
-extern const struct squashfs_decompressor squashfs_lzo_comp_ops;
Signature · 1 line
1.6.3.3