mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Minfei Huang <mnfhuang@gmail.com>
To: akpm@linux-foundation.org, fengguang.wu@intel.com
Cc: linux-kernel@vger.kernel.org, Minfei Huang <mnfhuang@gmail.com>
Subject: [PATCH] Fix compiling error once merge define-kallsyms_cmp_symbol_t-as-function-type-to-simplify-the-code
Date: Mon, 20 Jul 2015 12:57:01 +0800	[thread overview]
Message-ID: <1437368221-46374-1-git-send-email-mnfhuang@gmail.com> (raw)

Code will fail to be compiled, once it is merged the patch
5ed0a999616a050af1268a99cc442fd0824a2b07(Define kallsyms_cmp_symbol_t
as function type to simplify the code).

The root cause which fails to compile is I included the linux/module.h
head file to linux/kallsyms.h. Now I write the patch to fix this issue,
and it passes on platform s390, x86_64, i386, etc..

    In file included from arch/s390/include/asm/elf.h:130:0,
                     from include/linux/elf.h:4,
                     from include/linux/module.h:14,
                     from include/linux/kallsyms.h:11,
                     from kernel/sched/auto_group.c:5:
 >> arch/s390/include/asm/mmu_context.h:80:0: warning: "finish_arch_post_lock_switch" redefined
     #define finish_arch_post_lock_switch finish_arch_post_lock_switch
     ^
    In file included from kernel/sched/auto_group.c:1:0:
    kernel/sched/sched.h:1072:0: note: this is the location of the previous definition
     # define finish_arch_post_lock_switch() do { } while (0)
     ^

Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
---
 include/linux/kallsyms.h | 4 +++-
 include/linux/module.h   | 4 +---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index e8ed37d..d48bfa3 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -8,7 +8,6 @@
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/stddef.h>
-#include <linux/module.h>
 
 #define KSYM_NAME_LEN 128
 #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \
@@ -16,6 +15,9 @@
 
 struct module;
 
+typedef int (*kallsyms_cmp_symbol_t)(void *, const char *,
+		struct module *, unsigned long);
+
 #ifdef CONFIG_KALLSYMS
 /* Lookup the address for a symbol. Returns 0 if not found. */
 unsigned long kallsyms_lookup_name(const char *name);
diff --git a/include/linux/module.h b/include/linux/module.h
index 848f084..6015912 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -22,6 +22,7 @@
 
 #include <linux/percpu.h>
 #include <asm/module.h>
+#include <linux/kallsyms.h>
 
 /* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */
 #define MODULE_SIG_STRING "~Module signature appended~\n"
@@ -273,9 +274,6 @@ const struct exception_table_entry *search_exception_tables(unsigned long add);
 
 struct notifier_block;
 
-typedef int (*kallsyms_cmp_symbol_t)(void *, const char *,
-		struct module *, unsigned long);
-
 #ifdef CONFIG_MODULES
 
 extern int modules_disabled; /* for sysctl */
-- 
2.2.2


                 reply	other threads:[~2015-07-20  4:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437368221-46374-1-git-send-email-mnfhuang@gmail.com \
    --to=mnfhuang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome