From patchwork Thu Mar 1 15:27:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 130276 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2951939edc; Thu, 1 Mar 2018 07:38:08 -0800 (PST) X-Google-Smtp-Source: AG47ELumq1/HYu4KlWaQCPHypjU5sRjGJwJwZs1FfjnWU8U56se4p/e4SQtECI1KysKF46gGP1UB X-Received: by 10.99.116.16 with SMTP id p16mr1794051pgc.194.1519918687871; Thu, 01 Mar 2018 07:38:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519918687; cv=none; d=google.com; s=arc-20160816; b=whFWI7L1OpRqq5tGevZzeBy+GXHEeqUI1Ex8C0zz8z/qvzUFuz4QXx1dzd1A5WqVPX ig/Xa3Ko4RXyglTeRb0u2ZL/xE8j9BRHmdNoZCZceCJl9Zr48/QdNWsLw2NBIDB9Sf4E M5lNn+YEjdVrm5WywvfMVVuqE1SK82hBheNEEHFQPgOHAmZOIeV/d/8wiGpXvoCY/wWK dr5YmmfuMSy+NpXXLGTK70HPV/OO4ePXw0jCbAHHTxVNApd6ePDvzkmMFFoKtdpP6NwH uwLzzwwfQYWyvqfAu+IK1x+L1wbGwQXVvypz56e302DJSV4l20r/HOpS16G2wV7SZYVr +H4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=DZc6GluJ6LdU8YDBcwEIkG3IbPwCLrQ6l6UG3yZLbmQ=; b=LN2oMG8u1P8YRC/FOwZCmbZLACA5TBSCUEH4glujJ5Aq2lhNXBjTo8/qaJtF3hKLTx MbNSzCOfBLzFDgRFMJw7i+MmQcINrmETXlPEhXZ8BroiDWYv8RtVaaFGWsPCe1w+wDF5 +izhFRjquVShkBuEKIMF2wq31KK2U0daJCzYwx8iisVqh8lYaZJyPQZEPfBzApb7Km4C zu0yS2Tt3fgh+9pZFtKA6Mh+Jeezu4xWnfSaN3S3hKqTHBrAR0RGTrGvCWWfQkS+JM4E JHv8hEd74lzGJVi5hlHQWgio7LDPhN6NpXYJm3Al0kOyzj7Zeq/3WIu/CccVQIVhcHFw rFMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=OWFMJA7R; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10-v6si2863008plk.730.2018.03.01.07.38.07; Thu, 01 Mar 2018 07:38:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=OWFMJA7R; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032511AbeCAPiF (ORCPT + 10 others); Thu, 1 Mar 2018 10:38:05 -0500 Received: from mail-sn1nam02on0139.outbound.protection.outlook.com ([104.47.36.139]:6330 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032292AbeCAPhv (ORCPT ); Thu, 1 Mar 2018 10:37:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=DZc6GluJ6LdU8YDBcwEIkG3IbPwCLrQ6l6UG3yZLbmQ=; b=OWFMJA7RZbmk6ZJ4uJ8FSp1pzxv6AM5YzWI6/g6Pu0sBopGP4v7iyK6YMWD6kLXvAd8TSq+vGrUPn0hZkG6RXaTyejzzoRW//s6jguqCiqkFsWQjySXVkCAZnRV8XIpybKwZ/WLMN/OfJcdoI3HDl+M2KY6we0I65Ryc98/sW5I= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0982.namprd21.prod.outlook.com (52.132.133.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.567.2; Thu, 1 Mar 2018 15:37:46 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0567.006; Thu, 1 Mar 2018 15:37:46 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "stable-commits@vger.kernel.org" CC: Arnd Bergmann , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [added to the 4.1 stable tree] profile: hide unused functions when !CONFIG_PROC_FS Thread-Topic: [added to the 4.1 stable tree] profile: hide unused functions when !CONFIG_PROC_FS Thread-Index: AQHTsXHGHBQjiFjPYkKZDpYEOLekYQ== Date: Thu, 1 Mar 2018 15:27:14 +0000 Message-ID: <20180301152116.1486-445-alexander.levin@microsoft.com> References: <20180301152116.1486-1-alexander.levin@microsoft.com> In-Reply-To: <20180301152116.1486-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB0982; 7:B71YfBmRuCCikO57iGiC7cvk0ot1ahBAY3YS2HeIqrtxeGxWFOJt2dg/HtREh3MfcrN3ZEyVMpn09xpBO7V/693pa8NRPAc7MjcV0vcz7z0XxgjrdHcibn5BwafJ9KuVDizdn7tzgpDsQSMIJ28AxY2t65LGyjeXT7FFkiZBkaE+oRB8TocY5gRdkZZ6mjH/Q1fIZQMcZJ8eQRJ38lriGXTiiMwA3lHMGdY9s21nKu0vU/GkcuL6ACytnqBjyNmK x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: bdcc8590-7adb-4055-8a97-08d57f8a61ac x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7193020); SRVR:DM5PR2101MB0982; x-ms-traffictypediagnostic: DM5PR2101MB0982: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040501)(2401047)(5005006)(8121501046)(3002001)(3231220)(944501225)(52105095)(10201501046)(93006095)(93001095)(6055026)(61426038)(61427038)(6041288)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR2101MB0982; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0982; x-forefront-prvs: 05986C03E0 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(346002)(39860400002)(39380400002)(396003)(366004)(189003)(199004)(6506007)(59450400001)(53936002)(6346003)(6436002)(102836004)(5250100002)(6666003)(107886003)(26005)(186003)(6512007)(2950100002)(2501003)(86362001)(4326008)(25786009)(1076002)(54906003)(316002)(110136005)(106356001)(22452003)(14454004)(66066001)(99286004)(76176011)(6116002)(3846002)(97736004)(3660700001)(105586002)(2900100001)(68736007)(478600001)(7736002)(72206003)(305945005)(86612001)(10290500003)(8936002)(10090500001)(8676002)(81156014)(81166006)(5660300001)(3280700002)(2906002)(36756003)(6486002)(22906009); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0982; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: oj+wlDq2VAXYILT9VlECr8TKyvfLSceTIeuOlTkiXT/YG2Foop20qs4uiSEiMnemjhirCJcSkjuFh51lMQCATEK67kLidxPFM5lARpRKJnhXIQIwpjueX3l93/FqwpYbiOaBaWnIDxyun16DEpabBcdjaTnB0At7fEpL9g7wbQw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: bdcc8590-7adb-4055-8a97-08d57f8a61ac X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2018 15:27:14.7643 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0982 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann This patch has been added to the 4.1 stable tree. If you have any objections, please let us know. -- 2.14.1 =============== [ Upstream commit ade356b99a4187578609f2a91c4d2ed88e4e70dc ] 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: Sasha Levin --- kernel/profile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/profile.c b/kernel/profile.c index a7bcd28d6e9f..7ad939c708b9 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