Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3969961ybi; Mon, 29 Jul 2019 16:31:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpHVHFmqq4aVHlUDD2nEz8SBHuXqZzgSBx6GZTbQ+DWgV0h3svqytgo9E3fWhkawrpJhRm X-Received: by 2002:a65:5183:: with SMTP id h3mr13683462pgq.250.1564443107142; Mon, 29 Jul 2019 16:31:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564443107; cv=none; d=google.com; s=arc-20160816; b=KRiF6XfHJxTpOUsiz72h32Ib0+j8nliUCmYXoysPp6vIHt96hwxKwfIzgNmiOK5UlA H/VeQ20JReztWJgiTAEqBP3Ht0vZml8HzAuFwKbZIyC+sd/STEiBCucMIqCstNpaBwBt OhfijD2uHoUMSCLSjwcVRSh4bdOJGEz+EqLXzK8mcvFsJGycvfuNvYQmcXOteWO0SfN8 GSBlXO8/Gs4xNCzbUUsjrllOD0/boRK0gStEE1xMExrtlwyhPt3QQxcWpcTZaFxUaCO8 +mAH7ZQTu8tdDzVuj5yVYjy2MwkiHK5yBMEyywR09LmzOYYKWAueE6HxjttjNCUtvEOv Ft8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UQWlzLaX6gEuNiZti2EE/y2TFSiKFj7nsJfjjlmNnFM=; b=AvfQYcDK8NxFFdxXOkCgMgdEBqwpso1qOW/9iyrBIMsQcLMLLyE+gp8//4APHN1d7c UA9kNrLv7xU1Ok/e5ZxLw8fOahBp0muugirKeosylRuxTrrSGF5FyjJ7bBJOmISqYCO/ +cgQGiXS9f0RSaYrf/B6IPJN2fxGl8q6bwmGiBpsQYhj7xxSFCIvYCxL7NIrTPVemg6k yK14C4/6SAI+N+vXJumeElVc+vUUHZNJcbDc52eo3WiSZM2tav1hTX6tXc0llVv8XHuV 9QUE3DmFg5UvG6/J7TKVczGWYmzRlwMq5FC5j7GWTRu/bdrzMDebKgQ8vL6bsOVMeG0K Fz4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tdAbFtSt; 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 h98si25862528plb.206.2019.07.29.16.31.31; Mon, 29 Jul 2019 16:31:47 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=tdAbFtSt; 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 S1729730AbfG2T0Q (ORCPT + 99 others); Mon, 29 Jul 2019 15:26:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:38638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729211AbfG2T0O (ORCPT ); Mon, 29 Jul 2019 15:26:14 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0285A21655; Mon, 29 Jul 2019 19:26:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428373; bh=3BeJpKaq+DjbFnhS2ryuE8FGycUhgPvepnWyWM0en0E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tdAbFtStYHa2XqiNWwpxaLE6vr7UuaIr5SyGGiICG4KgZZoVAmuoBk+pg6zsh7HHW z11QeL3aTzsVtK/UtB/EIrtrJsg26XNgVlPW1Y6ONLFStZAttn+sE3VpZ+7JDmKetf jqTi5PgLrDhsJO0LBSAvh+q+u27p40JWITlNBRdo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qian Cai , "Peter Zijlstra (Intel)" , Linus Torvalds , Thomas Gleixner , Ingo Molnar , Sasha Levin Subject: [PATCH 4.14 054/293] sched/fair: Fix "runnable_avg_yN_inv" not used warnings Date: Mon, 29 Jul 2019 21:19:05 +0200 Message-Id: <20190729190828.058944959@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 509466b7d480bc5d22e90b9fbe6122ae0e2fbe39 ] 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 Signed-off-by: Sasha Levin --- 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, -- 2.20.1