Fixes commit 8c3d220cb6b5 ("gcov: clang support")

Cc: Greg Hackmann <ghackm...@android.com>
Cc: Tri Vo <tr...@android.com>
Cc: Peter Oberparleiter <ober...@linux.ibm.com>
Cc: linux...@kvack.org
Cc: kbuild-...@01.org
Reported-by: Randy Dunlap <rdun...@infradead.org>
Reported-by: kbuild test robot <l...@intel.com>
Link: https://marc.info/?l=linux-mm&m=155384681109231&w=2
Signed-off-by: Nick Desaulniers <ndesaulni...@google.com>
---
 kernel/gcov/gcc_3_4.c | 4 ++++
 kernel/gcov/gcc_4_7.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/kernel/gcov/gcc_3_4.c b/kernel/gcov/gcc_3_4.c
index 801ee4b0b969..8fc30f178351 100644
--- a/kernel/gcov/gcc_3_4.c
+++ b/kernel/gcov/gcc_3_4.c
@@ -146,7 +146,11 @@ void gcov_info_unlink(struct gcov_info *prev, struct 
gcov_info *info)
  */
 bool gcov_info_within_module(struct gcov_info *info, struct module *mod)
 {
+#ifdef CONFIG_MODULES
        return within_module((unsigned long)info, mod);
+#else
+       return false;
+#endif
 }
 
 /* Symbolic links to be created for each profiling data file. */
diff --git a/kernel/gcov/gcc_4_7.c b/kernel/gcov/gcc_4_7.c
index ec37563674d6..0b6886d4a4dd 100644
--- a/kernel/gcov/gcc_4_7.c
+++ b/kernel/gcov/gcc_4_7.c
@@ -159,7 +159,11 @@ void gcov_info_unlink(struct gcov_info *prev, struct 
gcov_info *info)
  */
 bool gcov_info_within_module(struct gcov_info *info, struct module *mod)
 {
+#ifdef CONFIG_MODULES
        return within_module((unsigned long)info, mod);
+#else
+       return false;
+#endif
 }
 
 /* Symbolic links to be created for each profiling data file. */
-- 
2.21.0.392.gf8f6787159e-goog

Reply via email to