lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4D263716.3070802@lougher.demon.co.uk>
Date:	Thu, 06 Jan 2011 21:41:42 +0000
From:	Phillip Lougher <phillip@...gher.demon.co.uk>
To:	Linux Kernel Development <linux-kernel@...r.kernel.org>
CC:	linux-fsdevel@...r.kernel.org
Subject: [PATCH 5/5] 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@...gher.demon.co.uk>
---
  fs/squashfs/decompressor.c |    8 ++------
  fs/squashfs/decompressor.h |    5 +++++
  fs/squashfs/squashfs.h     |    3 ---
  3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/fs/squashfs/decompressor.c b/fs/squashfs/decompressor.c
index d83e184..1700065 100644
--- a/fs/squashfs/decompressor.c
+++ b/fs/squashfs/decompressor.c
@@ -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
  };

diff --git a/fs/squashfs/decompressor.h b/fs/squashfs/decompressor.h
index 7425f80..805bd0e 100644
--- a/fs/squashfs/decompressor.h
+++ b/fs/squashfs/decompressor.h
@@ -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
diff --git a/fs/squashfs/squashfs.h b/fs/squashfs/squashfs.h
index 18f187f..ba729d8 100644
--- a/fs/squashfs/squashfs.h
+++ b/fs/squashfs/squashfs.h
@@ -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;
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ