4.4-stable review patch.  If anyone has any objections, please let me know.


From: Arnd Bergmann <a...@arndb.de>

commit ade356b99a4187578609f2a91c4d2ed88e4e70dc upstream.

A couple of functions and variables in the profile implementation are
used only on SMP systems by the procfs code, but are unused if either
procfs is disabled or in uniprocessor kernels.  gcc prints a harmless
warning about the unused symbols:

  kernel/profile.c:243:13: error: 'profile_flip_buffers' defined but not used 
   static void profile_flip_buffers(void)
  kernel/profile.c:266:13: error: 'profile_discard_flip_buffers' defined but 
not used [-Werror=unused-function]
   static void profile_discard_flip_buffers(void)
  kernel/profile.c:330:12: error: 'profile_cpu_callback' defined but not used 
   static int profile_cpu_callback(struct notifier_block *info,

This adds further #ifdef to the file, to annotate exactly in which cases
they are used.  I have done several thousand ARM randconfig kernels with
this patch applied and no longer get any warnings in this file.

Signed-off-by: Arnd Bergmann <a...@arndb.de>
Cc: Vlastimil Babka <vba...@suse.cz>
Cc: Robin Holt <robinmh...@gmail.com>
Cc: Johannes Weiner <han...@cmpxchg.org>
Cc: Christoph Lameter <c...@linux.com>
Cc: Tejun Heo <t...@kernel.org>
Signed-off-by: Andrew Morton <a...@linux-foundation.org>
Signed-off-by: Linus Torvalds <torva...@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

 kernel/profile.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -44,7 +44,7 @@ int prof_on __read_mostly;
 static cpumask_var_t prof_cpu_mask;
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && defined(CONFIG_PROC_FS)
 static DEFINE_PER_CPU(struct profile_hit *[2], cpu_profile_hits);
 static DEFINE_PER_CPU(int, cpu_profile_flip);
 static DEFINE_MUTEX(profile_flip_mutex);
@@ -201,7 +201,7 @@ int profile_event_unregister(enum profil
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && defined(CONFIG_PROC_FS)
  * Each cpu has a pair of open-addressed hashtables for pending
  * profile hits. read_profile() IPI's all cpus to request them

Reply via email to