Received: by 10.223.185.116 with SMTP id b49csp1131757wrg; Fri, 23 Feb 2018 12:29:45 -0800 (PST) X-Google-Smtp-Source: AH8x226Fkke2XrWXKMQrHdev9717+feZ9zwU9NyiURBl0hydbUUrE3EPPWheykXKHWDLMVZv/gob X-Received: by 10.98.9.130 with SMTP id 2mr2903218pfj.149.1519417784929; Fri, 23 Feb 2018 12:29:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519417784; cv=none; d=google.com; s=arc-20160816; b=c5H2mtb+rDza1Q7MNwskHxZGIAJ6X74XpBd1ekxkS0e+eRKfmL8w4CqJHQipdURZa3 xKHwXT6+vfrwT5jVsGW9Iv17ING8Z5pdb6d3/sg510FAhRtd5b5TNEStrSZKjUGZP8bQ TEGCdBuL+u+HwoRG8ezTq9+oKxTenH6AWLYQ5LUtpG4aIVjDFB0L3MDy0CJfRPISvQKc 5tVljcoZpatX4AqhZh168GIWJOIiKxX6+5EAK+6e7w9LadgK70/nibsHQVdGYx3MX0MA iTVARMhQEV0omTEE3++tmkFrGvvtxzSyIyHAWHVRx0nTzP0YPwd74BvFlDunEQ0O/Rpo U+aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=1N6gQ0pUSdTxgQ70856wEyg/nJjdm6Ov2LjjublG/jk=; b=L9t2R2oEsPtAQeQFIwjYKTMH4vd0E480/P0jRiDDGocA+IdcaejkLbwvn3do6MyY+w qWPU1ghXBYJlNZR+HhZtZcOBoy/Tk4Oc55yrrrFX8I8XA64qd2SX+x3+jkWPN5DE1p96 Vp9CpRS/HtcVl7w9uxivK0H8bPahvnCrF7vzFTNVCkUxTPgyizxY3Q/JTv9qa5DvU6bL oNBygNugVPjaTy07ja8pBOmYl1ToyrFdx7gOIQ61+p48iORkzClm78asriEfUDke65NP Ix1sSRw4qgmLlAoQQu4m7X+IpQfPkSnOZz3r49wtFExkHxXJqVjq8Q0CVQDPnLIzlTgv cLWQ== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x6-v6si2247860pln.708.2018.02.23.12.29.30; Fri, 23 Feb 2018 12:29:44 -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 S932115AbeBWSgm (ORCPT + 99 others); Fri, 23 Feb 2018 13:36:42 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:37874 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932097AbeBWSgk (ORCPT ); Fri, 23 Feb 2018 13:36:40 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2D5001318; Fri, 23 Feb 2018 18:36:39 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Vlastimil Babka , Robin Holt , Johannes Weiner , Christoph Lameter , Tejun Heo , Andrew Morton , Linus Torvalds Subject: [PATCH 4.4 087/193] profile: hide unused functions when !CONFIG_PROC_FS Date: Fri, 23 Feb 2018 19:25:20 +0100 Message-Id: <20180223170339.676998379@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170325.997716448@linuxfoundation.org> References: <20180223170325.997716448@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann 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 [-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 Cc: Vlastimil Babka Cc: Robin Holt Cc: Johannes Weiner Cc: Christoph Lameter Cc: Tejun Heo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- 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; 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 profil } 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