瀏覽代碼

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>
Phillip Lougher 14 年之前
父節點
當前提交
01a678c5a2
共有 3 個文件被更改,包括 6 次插入9 次删除
  1. 2 6
      fs/squashfs/decompressor.c
  2. 4 0
      fs/squashfs/decompressor.h
  3. 0 3
      fs/squashfs/squashfs.h

+ 2 - 6
fs/squashfs/decompressor.c

@@ -40,7 +40,7 @@ static const struct squashfs_decompressor squashfs_lzma_unsupported_comp_ops = {
 };
 };
 
 
 #ifndef CONFIG_SQUASHFS_LZO
 #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
 	NULL, NULL, NULL, LZO_COMPRESSION, "lzo", 0
 };
 };
 #endif
 #endif
@@ -57,13 +57,9 @@ static const struct squashfs_decompressor squashfs_unknown_comp_ops = {
 
 
 static const struct squashfs_decompressor *decompressor[] = {
 static const struct squashfs_decompressor *decompressor[] = {
 	&squashfs_zlib_comp_ops,
 	&squashfs_zlib_comp_ops,
-	&squashfs_lzma_unsupported_comp_ops,
-#ifdef CONFIG_SQUASHFS_LZO
 	&squashfs_lzo_comp_ops,
 	&squashfs_lzo_comp_ops,
-#else
-	&squashfs_lzo_unsupported_comp_ops,
-#endif
 	&squashfs_xz_comp_ops,
 	&squashfs_xz_comp_ops,
+	&squashfs_lzma_unsupported_comp_ops,
 	&squashfs_unknown_comp_ops
 	&squashfs_unknown_comp_ops
 };
 };
 
 

+ 4 - 0
fs/squashfs/decompressor.h

@@ -57,4 +57,8 @@ static inline int squashfs_decompress(struct squashfs_sb_info *msblk,
 extern const struct squashfs_decompressor squashfs_xz_comp_ops;
 extern const struct squashfs_decompressor squashfs_xz_comp_ops;
 #endif
 #endif
 
 
+#ifdef CONFIG_SQUASHFS_LZO
+extern const struct squashfs_decompressor squashfs_lzo_comp_ops;
+#endif
+
 #endif
 #endif

+ 0 - 3
fs/squashfs/squashfs.h

@@ -99,6 +99,3 @@ extern const struct xattr_handler *squashfs_xattr_handlers[];
 
 
 /* zlib_wrapper.c */
 /* zlib_wrapper.c */
 extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
 extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
-
-/* lzo_wrapper.c */
-extern const struct squashfs_decompressor squashfs_lzo_comp_ops;