• Arnd Bergmann's avatar
    profile: hide unused functions when !CONFIG_PROC_FS · ade356b9
    Arnd Bergmann authored
    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 [-Werror=unused-function]
       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 [-Werror=unused-function]
       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: default avatarArnd Bergmann <arnd@arndb.de>
    Cc: Vlastimil Babka <vbabka@suse.cz>
    Cc: Robin Holt <robinmholt@gmail.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Christoph Lameter <cl@linux.com>
    Cc: Tejun Heo <tj@kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    ade356b9
profile.c 16.2 KB