summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2022-02-15 13:11:42 -0800
committerLuis Chamberlain <mcgrof@kernel.org>2022-02-16 12:51:32 -0800
commita8e8f851e8299703a005cf23dfb9ec854a2611e5 (patch)
treeba83971d5b8362610ac7f43bf41b70afdbad49d4
parent3593030761630e09200072a4bd06468892c27be3 (diff)
downloadlwn-a8e8f851e8299703a005cf23dfb9ec854a2611e5.tar.gz
lwn-a8e8f851e8299703a005cf23dfb9ec854a2611e5.zip
module: fix building with sysfs disabled
Sysfs support might be disabled so we need to guard the code that instantiates "compression" attribute with an #ifdef. Fixes: b1ae6dc41eaa ("module: add in-kernel support for decompressing") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
-rw-r--r--kernel/module_decompress.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/module_decompress.c b/kernel/module_decompress.c
index b01c69c2ff99..ffef98a20320 100644
--- a/kernel/module_decompress.c
+++ b/kernel/module_decompress.c
@@ -250,6 +250,7 @@ void module_decompress_cleanup(struct load_info *info)
info->max_pages = info->used_pages = 0;
}
+#ifdef CONFIG_SYSFS
static ssize_t compression_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
@@ -269,3 +270,4 @@ static int __init module_decompress_sysfs_init(void)
return 0;
}
late_initcall(module_decompress_sysfs_init);
+#endif