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: 8109751 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7C79CBEEE5 for ; Mon, 25 Jan 2016 15:41:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9D5F92025B for ; Mon, 25 Jan 2016 15:41:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A0379201F4 for ; Mon, 25 Jan 2016 15:41:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aNjFP-0005Ii-V4; Mon, 25 Jan 2016 15:40:07 +0000 Received: from mout.kundenserver.de ([217.72.192.74]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aNjFL-0004dh-Ag for linux-arm-kernel@lists.infradead.org; Mon, 25 Jan 2016 15:40:04 +0000 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 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= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160125_074003_772040_B80EB281 X-CRM114-Status: GOOD ( 10.70 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Robin Holt , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Johannes Weiner , Tejun Heo , Christoph Lameter , Vlastimil Babka MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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