From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753013AbbGTE5P (ORCPT ); Mon, 20 Jul 2015 00:57:15 -0400 Received: from mail-pd0-f193.google.com ([209.85.192.193]:33250 "EHLO mail-pd0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751333AbbGTE5N (ORCPT ); Mon, 20 Jul 2015 00:57:13 -0400 From: Minfei Huang To: akpm@linux-foundation.org, fengguang.wu@intel.com Cc: linux-kernel@vger.kernel.org, Minfei Huang 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 Message-Id: <1437368221-46374-1-git-send-email-mnfhuang@gmail.com> X-Mailer: git-send-email 2.2.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 #include #include -#include #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 #include +#include /* 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