From patchwork Mon Jan 25 15:39:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101127 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1430732lbb; Mon, 25 Jan 2016 07:40:17 -0800 (PST) X-Received: by 10.98.0.7 with SMTP id 7mr26838321pfa.5.1453736416236; Mon, 25 Jan 2016 07:40:16 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id we3si34335827pab.52.2016.01.25.07.40.15; Mon, 25 Jan 2016 07:40:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757473AbcAYPkO (ORCPT + 30 others); Mon, 25 Jan 2016 10:40:14 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:50978 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753549AbcAYPkK (ORCPT ); Mon, 25 Jan 2016 10:40:10 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0LheU5-1Zkar03NUf-00mrxD; Mon, 25 Jan 2016 16:39:35 +0100 From: Arnd Bergmann To: Andrew Morton Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Vlastimil Babka , Robin Holt , Johannes Weiner , Christoph Lameter , Tejun Heo , linux-kernel@vger.kernel.org Subject: [PATCH] profile: hide unused functions when !CONFIG_PROC_FS Date: Mon, 25 Jan 2016 16:39:12 +0100 Message-Id: <1453736359-1959049-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:Omg0XxZh6O/wU1Pxogw1gwppjoVRXz1Ruv0aLyENbFord0JgYeZ W4cKNLpVNQSXKbm55K/1IU+qXi1aINd8xmBnd5en8+FUv7QwGOrz95tKrSXGBep0ZM/dQ0E cHJ/UqFnBVF4nfhAN2g95LXR0oLG6CR6yEfBGi5OLksfVgVD39odgMtJNE26VIRRojjwBKA Wnv+xEZcof+pw7hNxlg/w== X-UI-Out-Filterresults: notjunk:1; V01:K0:ge46GetrJnU=:AGZNfJ/bUifRU0LCzYAbtr pmo7YC3OCEshTMoviAn2bQ9XUFiJuGZ/+TMYY0vhJ57E40DM2t8KxzXcw6z3kp5gJs5Vr0C7D YMHPjoDmx4HhwjTCoTNf/NmK8E+44NB5dkcrwTmRqoDaDaIH+pGE4ez8TqXuztwE2d/axuJZ5 HMhqk7psNLqrpXkVO1TXmhKWPpheFkEn84JXnvvrRpdcLXDAtTnl/DhYULh6WPNpkaqRQbu9X FYbsB4Wy9FRFKd8Rr9hPzd0ToIClbBSlS+v+xPEtLAgvacKD1utgK/6pURo5ThTwsX9NRkYs9 jo4occbW6AS7zCKlroTfM0u4YnkuBVWCB/0X78ZNVP6GYykuPuvAdMtN43EEvxyAg4ziYkLQW +HJsxJTECQeUr/nyZ7Fsy4Ntcx40iYcQzhzqiDwvIrjAygy4Q9G7Zl3xGSplxmzb5d40xy9m4 QrdDl4aXBCwUhADXAa+xfZN9ciQQMFXMUFOzFLcHzdmqBG8yCJYIH03zpIodGs9ww5eNRFiCg RbfaEbyN1F3hMwVz8znvxN27MlpsOz5d5b+3TuArucXmHdRIFMf1PHP0bAdu70BzSWzv1D4/J glIJzA52wP6p1xEgM2KQrlDaKn4f4roNyxsYZshzFtZNFhPmZq58mKnbw9s9kbvu7D5+8WgDz vO+P9YN4bDL9S+89bkkM12dkZQFFUpprlZ8RlhmmippUl+ZwZ3zDh1FuppiWum2Decic= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Arnd Bergmann --- kernel/profile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.0 diff --git a/kernel/profile.c b/kernel/profile.c index 99513e1160e5..9cd8e18e6f18 100644 --- a/kernel/profile.c +++ b/kernel/profile.c @@ -44,7 +44,7 @@ int prof_on __read_mostly; EXPORT_SYMBOL_GPL(prof_on); 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 profile_type type, struct notifier_block *n) } EXPORT_SYMBOL_GPL(profile_event_unregister); -#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