config PSTORE
tristate "Persistent store support"
+ select CRYPTO if PSTORE_COMPRESS
default n
help
This option enables generic access to platform level
say N.
config PSTORE_DEFLATE_COMPRESS
- bool "DEFLATE (ZLIB) compression"
+ tristate "DEFLATE (ZLIB) compression"
default y
depends on PSTORE
select CRYPTO_DEFLATE
algorithm support.
config PSTORE_LZO_COMPRESS
- bool "LZO compression"
+ tristate "LZO compression"
depends on PSTORE
select CRYPTO_LZO
help
This option enables LZO compression algorithm support.
config PSTORE_LZ4_COMPRESS
- bool "LZ4 compression"
+ tristate "LZ4 compression"
depends on PSTORE
select CRYPTO_LZ4
help
This option enables LZ4 compression algorithm support.
config PSTORE_LZ4HC_COMPRESS
- bool "LZ4HC compression"
+ tristate "LZ4HC compression"
depends on PSTORE
select CRYPTO_LZ4HC
help
The default compression algorithm is deflate.
config PSTORE_DEFLATE_COMPRESS_DEFAULT
- bool "deflate" if PSTORE_DEFLATE_COMPRESS=y
+ bool "deflate" if PSTORE_DEFLATE_COMPRESS
config PSTORE_LZO_COMPRESS_DEFAULT
- bool "lzo" if PSTORE_LZO_COMPRESS=y
+ bool "lzo" if PSTORE_LZO_COMPRESS
config PSTORE_LZ4_COMPRESS_DEFAULT
- bool "lz4" if PSTORE_LZ4_COMPRESS=y
+ bool "lz4" if PSTORE_LZ4_COMPRESS
config PSTORE_LZ4HC_COMPRESS_DEFAULT
- bool "lz4hc" if PSTORE_LZ4HC_COMPRESS=y
+ bool "lz4hc" if PSTORE_LZ4HC_COMPRESS
config PSTORE_842_COMPRESS_DEFAULT
- bool "842" if PSTORE_842_COMPRESS=y
+ bool "842" if PSTORE_842_COMPRESS
endchoice
#include <linux/console.h>
#include <linux/module.h>
#include <linux/pstore.h>
-#ifdef CONFIG_PSTORE_LZO_COMPRESS
+#if IS_ENABLED(CONFIG_PSTORE_LZO_COMPRESS)
#include <linux/lzo.h>
#endif
-#if defined(CONFIG_PSTORE_LZ4_COMPRESS) || defined(CONFIG_PSTORE_LZ4HC_COMPRESS)
+#if IS_ENABLED(CONFIG_PSTORE_LZ4_COMPRESS) || IS_ENABLED(CONFIG_PSTORE_LZ4HC_COMPRESS)
#include <linux/lz4.h>
#endif
#include <linux/crypto.h>
}
EXPORT_SYMBOL_GPL(pstore_cannot_block_path);
-#ifdef CONFIG_PSTORE_DEFLATE_COMPRESS
+#if IS_ENABLED(CONFIG_PSTORE_DEFLATE_COMPRESS)
static int zbufsize_deflate(size_t size)
{
size_t cmpr;
}
#endif
-#ifdef CONFIG_PSTORE_LZO_COMPRESS
+#if IS_ENABLED(CONFIG_PSTORE_LZO_COMPRESS)
static int zbufsize_lzo(size_t size)
{
return lzo1x_worst_compress(size);
}
#endif
-#if defined(CONFIG_PSTORE_LZ4_COMPRESS) || defined(CONFIG_PSTORE_LZ4HC_COMPRESS)
+#if IS_ENABLED(CONFIG_PSTORE_LZ4_COMPRESS) || IS_ENABLED(CONFIG_PSTORE_LZ4HC_COMPRESS)
static int zbufsize_lz4(size_t size)
{
return LZ4_compressBound(size);
}
#endif
-#ifdef CONFIG_PSTORE_842_COMPRESS
+#if IS_ENABLED(CONFIG_PSTORE_842_COMPRESS)
static int zbufsize_842(size_t size)
{
return size;
static const struct pstore_zbackend *zbackend __ro_after_init;
static const struct pstore_zbackend zbackends[] = {
-#ifdef CONFIG_PSTORE_DEFLATE_COMPRESS
+#if IS_ENABLED(CONFIG_PSTORE_DEFLATE_COMPRESS)
{
.zbufsize = zbufsize_deflate,
.name = "deflate",
},
#endif
-#ifdef CONFIG_PSTORE_LZO_COMPRESS
+#if IS_ENABLED(CONFIG_PSTORE_LZO_COMPRESS)
{
.zbufsize = zbufsize_lzo,
.name = "lzo",
},
#endif
-#ifdef CONFIG_PSTORE_LZ4_COMPRESS
+#if IS_ENABLED(CONFIG_PSTORE_LZ4_COMPRESS)
{
.zbufsize = zbufsize_lz4,
.name = "lz4",
},
#endif
-#ifdef CONFIG_PSTORE_LZ4HC_COMPRESS
+#if IS_ENABLED(CONFIG_PSTORE_LZ4HC_COMPRESS)
{
.zbufsize = zbufsize_lz4,
.name = "lz4hc",
},
#endif
-#ifdef CONFIG_PSTORE_842_COMPRESS
+#if IS_ENABLED(CONFIG_PSTORE_842_COMPRESS)
{
.zbufsize = zbufsize_842,
.name = "842",