From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3352C31E50 for ; Mon, 17 Jun 2019 14:21:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B5AC72084B for ; Mon, 17 Jun 2019 14:21:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="qU3VPpgN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727987AbfFQOVk (ORCPT ); Mon, 17 Jun 2019 10:21:40 -0400 Received: from terminus.zytor.com ([198.137.202.136]:43399 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726215AbfFQOVk (ORCPT ); Mon, 17 Jun 2019 10:21:40 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x5HELUfB3453635 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 17 Jun 2019 07:21:30 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x5HELUfB3453635 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019051801; t=1560781290; bh=F8IsWyt3EteXIZmOWeWiBQayXeMA865ruphPYM3yGvI=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=qU3VPpgN5LnRUPx9XjnUz8nbcWlck7UPuzO1Cbf6+btwIM9HY5bfIwC4hy85EHgtA YUgqMGkqwEBqbiCAib81l3DX+FX0jpSwUQYUbHbMEUmGTISeHcvNX7IlGZrhsSgUZ6 5pMGZFYANkEK4c+4AT0L/K9/0QiFFUVTz2G9JkZ8TW3iTY0mt8sezM1qbE/ymGWVOC 2vcJQATaibNBplWxAOegN4NJz9eaUY4lJHnEKckbf8bFupt+SeavJ9AcQ2uX1QlJeK Rceps4dUM0Hcx1kBc5smWnQ0P+n4IIG8AxUivs6BkZgeO1wZQvs+L8wq4sidDGeF+8 NXPupClr2WbeQ== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x5HELTpf3453632; Mon, 17 Jun 2019 07:21:29 -0700 Date: Mon, 17 Jun 2019 07:21:29 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Qian Cai Message-ID: Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de, peterz@infradead.org, torvalds@linux-foundation.org, cai@lca.pw Reply-To: peterz@infradead.org, cai@lca.pw, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com In-Reply-To: <1559596304-31581-1-git-send-email-cai@lca.pw> References: <1559596304-31581-1-git-send-email-cai@lca.pw> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/fair: Fix "runnable_avg_yN_inv" not used warnings Git-Commit-ID: 509466b7d480bc5d22e90b9fbe6122ae0e2fbe39 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 509466b7d480bc5d22e90b9fbe6122ae0e2fbe39 Gitweb: https://git.kernel.org/tip/509466b7d480bc5d22e90b9fbe6122ae0e2fbe39 Author: Qian Cai AuthorDate: Mon, 3 Jun 2019 17:11:44 -0400 Committer: Ingo Molnar CommitDate: Mon, 17 Jun 2019 12:15:58 +0200 sched/fair: Fix "runnable_avg_yN_inv" not used warnings runnable_avg_yN_inv[] is only used in kernel/sched/pelt.c but was included in several other places because they need other macros all came from kernel/sched/sched-pelt.h which was generated by Documentation/scheduler/sched-pelt. As the result, it causes compilation a lot of warnings, kernel/sched/sched-pelt.h:4:18: warning: 'runnable_avg_yN_inv' defined but not used [-Wunused-const-variable=] kernel/sched/sched-pelt.h:4:18: warning: 'runnable_avg_yN_inv' defined but not used [-Wunused-const-variable=] kernel/sched/sched-pelt.h:4:18: warning: 'runnable_avg_yN_inv' defined but not used [-Wunused-const-variable=] ... Silence it by appending the __maybe_unused attribute for it, so all generated variables and macros can still be kept in the same file. Signed-off-by: Qian Cai Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/1559596304-31581-1-git-send-email-cai@lca.pw Signed-off-by: Ingo Molnar --- Documentation/scheduler/sched-pelt.c | 3 ++- kernel/sched/sched-pelt.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/scheduler/sched-pelt.c b/Documentation/scheduler/sched-pelt.c index e4219139386a..7238b355919c 100644 --- a/Documentation/scheduler/sched-pelt.c +++ b/Documentation/scheduler/sched-pelt.c @@ -20,7 +20,8 @@ void calc_runnable_avg_yN_inv(void) int i; unsigned int x; - printf("static const u32 runnable_avg_yN_inv[] = {"); + /* To silence -Wunused-but-set-variable warnings. */ + printf("static const u32 runnable_avg_yN_inv[] __maybe_unused = {"); for (i = 0; i < HALFLIFE; i++) { x = ((1UL<<32)-1)*pow(y, i); diff --git a/kernel/sched/sched-pelt.h b/kernel/sched/sched-pelt.h index a26473674fb7..c529706bed11 100644 --- a/kernel/sched/sched-pelt.h +++ b/kernel/sched/sched-pelt.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* Generated by Documentation/scheduler/sched-pelt; do not modify. */ -static const u32 runnable_avg_yN_inv[] = { +static const u32 runnable_avg_yN_inv[] __maybe_unused = { 0xffffffff, 0xfa83b2da, 0xf5257d14, 0xefe4b99a, 0xeac0c6e6, 0xe5b906e6, 0xe0ccdeeb, 0xdbfbb796, 0xd744fcc9, 0xd2a81d91, 0xce248c14, 0xc9b9bd85, 0xc5672a10, 0xc12c4cc9, 0xbd08a39e, 0xb8fbaf46, 0xb504f333, 0xb123f581,