]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
module: fix build error when CONFIG_SYSFS is disabled
authorBixuan Cui <cuibixuan@huawei.com>
Wed, 2 Jun 2021 03:53:29 +0000 (13:53 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 3 Jun 2021 08:17:07 +0000 (18:17 +1000)
Fix build error when disable CONFIG_SYSFS:
kernel/module.c:2805:8: error: implicit declaration of function `sect_empty'; did you mean `desc_empty'? [-Werror=implicit-function-declaration]
 2805 |   if (!sect_empty(sechdr) && sechdr->sh_type == SHT_NOTE &&

Link: https://lkml.kernel.org/r/20210525105049.34804-1-cuibixuan@huawei.com
Fixes: 9ee6682aa528 ("module: add printk formats to add module build ID to stacktraces")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Acked-by: Jessica Yu <jeyu@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
kernel/module.c

index e9bca16243628d0626a6d29a47597df6acc1762d..25dbdaf1f337951cdd96de374c2a0c8cde20857e 100644 (file)
@@ -1462,6 +1462,13 @@ resolve_symbol_wait(struct module *mod,
        return ksym;
 }
 
+#ifdef CONFIG_KALLSYMS
+static inline bool sect_empty(const Elf_Shdr *sect)
+{
+       return !(sect->sh_flags & SHF_ALLOC) || sect->sh_size == 0;
+}
+#endif
+
 /*
  * /sys/module/foo/sections stuff
  * J. Corbet <corbet@lwn.net>
@@ -1469,11 +1476,6 @@ resolve_symbol_wait(struct module *mod,
 #ifdef CONFIG_SYSFS
 
 #ifdef CONFIG_KALLSYMS
-static inline bool sect_empty(const Elf_Shdr *sect)
-{
-       return !(sect->sh_flags & SHF_ALLOC) || sect->sh_size == 0;
-}
-
 struct module_sect_attr {
        struct bin_attribute battr;
        unsigned long address;