Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6958509ybf; Fri, 6 Mar 2020 07:43:36 -0800 (PST) X-Google-Smtp-Source: ADFU+vsI+VaUsuhYaT4yfmH9gRS8VK1JGSxxYGajRH+x0lO10UJRmdFqz0kZH6I9df9SXh8YK/12 X-Received: by 2002:a05:6830:1481:: with SMTP id s1mr3082133otq.44.1583509416571; Fri, 06 Mar 2020 07:43:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583509416; cv=none; d=google.com; s=arc-20160816; b=P2RtH9vEzGNcvporkL1PlJLYRMYuqxGCjPKSjoYsFbvWXKEPMZI2pj/AmjCb60Ljsq NyPRKBnh5/kx+bLSi5IHyVgj2+0MnehYzY4RE8RcL4T3+httvceUb6NBRz5iaR3Eezgo zxn3zcelA6vk3fDrc9FTZwSIOzCnZvJacGxVbWh9ksNs3bM1lwrGkLKHFeiM8gbbL7me PCoFc6U9iTkHccoJNarr02Y9+iTxjHYFSL2ol4D9NCoQ8xnCyYfzpLHri+VsBNH+o497 FNJCCJB4hGrQWs6wMaCang10ZeGKw6vU/tGtARhBbCJstgr1PCoo2aCMeBKvCQBJA+sT ueAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=MXluHjiwZwq++M60EzdikuAJ7SQh4kY9FFj9/2rOI1E=; b=Ads3iUkj8An3KQBecSzWD7Zq6xuVoXt4zjAbTs3TXLF4jaR9/YhHqcjHZEb91tt+lS YTM6d/0+Xhnt4C2QISEsxxoRI+sxr+P/WA8M88TMj5QNnNbfizf1wQg/NwF7PrZ2gWnx yibwNvXx0tpHnDKihslDIxgH29GqoMcjb43pnXe2CAySWPOX/1O53cXlfIv5s7rrY/oE JFu9LssiD5GT7lGSB09HWD1m16IURJboNYBWkZrQk45/r9jnUJjJDD1ze1jQRGgLmopG 5l9zjM4P5svj/57kAk9OgQkThhlBR+W2fBGCkhQJrhdvGCYIh+i2nuYZ5pp116XBkyYH fIzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=XfqrDDLT; 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 22si1561534oij.227.2020.03.06.07.43.23; Fri, 06 Mar 2020 07:43:36 -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; dkim=pass header.i=@lca.pw header.s=google header.b=XfqrDDLT; 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 S1726928AbgCFPmD (ORCPT + 99 others); Fri, 6 Mar 2020 10:42:03 -0500 Received: from mail-qk1-f195.google.com ([209.85.222.195]:39457 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726879AbgCFPmD (ORCPT ); Fri, 6 Mar 2020 10:42:03 -0500 Received: by mail-qk1-f195.google.com with SMTP id e16so2678472qkl.6 for ; Fri, 06 Mar 2020 07:42:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=from:to:cc:subject:date:message-id; bh=MXluHjiwZwq++M60EzdikuAJ7SQh4kY9FFj9/2rOI1E=; b=XfqrDDLTdsV942+ut6/YkgkZKGbvL/q9ZDKBZ0SvOE4NI4GMCnyseOZpyMcDOvPNGZ mTMdszu0nM0VoZ9KQVwhiv1MaoW9CiMGkkSDgwfpNo+rPszSxt5LFgvP/O/UElXlpaE5 BfIuiyR3UHdZ8/O0mXSUnPq5cqK9esf6CxUNqemabp/DjlRZ2CeCXEtmbLhIIcEZapqG TPhQ3gttHvuK9qshLEbQhu4Qj9Pq+xPpZR05TVtTqCYr6pCGxbW+MMn9dFqJ2gvQRGNZ ZIbA1hZJUpf4ZLh3euFZfQex4glc1YCWqSdesgDun9OM/Wg1zgYXHz1KRwmMJL1wPVKP 0WUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=MXluHjiwZwq++M60EzdikuAJ7SQh4kY9FFj9/2rOI1E=; b=hHYEN0Hti0gGyJIewgK4dK4inhjPrAKR6Ae95qad06SL/qw1c51MyrqpUGjg6tNTFQ +2IL/HX0kiGH2yMZH99MI12hJ/WwbKYiW96vV0CkEJ2tcIaM1YUPoXxX3XTP6rXq7sPS teC8Hx8u0kRU2iMPCdeGJN4X1+nSnRIbMRqlvViUcTYRPJXOPpT8IJ0yrZH6pJavQsXu iX1OGNvsRIr9Bb2HkwSjh49tmbdOvmfpwUpMzWNvnwIc+4fbcMZQOL7c4pS4nS9uAY3Q 9UdKGJpNvNNEewGZ2tBHL3hNXfXP8NOC35LXwe3QRA5AXyZOUAvvtPlji/5EYaCxHDyr p74A== X-Gm-Message-State: ANhLgQ0fLJGJHExqYqwhZVO+JWC86yMZyOfo18u9ECYHovwjseKrUJ1C 4ao2vdjOBmczTY5u5liksci1MQ== X-Received: by 2002:a37:ef04:: with SMTP id j4mr3491798qkk.68.1583509322259; Fri, 06 Mar 2020 07:42:02 -0800 (PST) Received: from qcai.nay.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id w11sm13942407qti.54.2020.03.06.07.42.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Mar 2020 07:42:01 -0800 (PST) From: Qian Cai To: peterz@infradead.org, mingo@redhat.com Cc: juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Qian Cai Subject: [PATCH] sched/cputime: silence a -Wunused-function warning Date: Fri, 6 Mar 2020 10:41:44 -0500 Message-Id: <1583509304-28508-1-git-send-email-cai@lca.pw> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org account_other_time() is only used when CONFIG_IRQ_TIME_ACCOUNTING=y (in irqtime_account_process_tick()) or CONFIG_VIRT_CPU_ACCOUNTING_GEN=y (in get_vtime_delta()). When both are off, it will generate a compilation warning from Clang, kernel/sched/cputime.c:255:19: warning: unused function 'account_other_time' [-Wunused-function] static inline u64 account_other_time(u64 max) Rather than wrapping around this function with a macro expression, if defined(CONFIG_IRQ_TIME_ACCOUNTING) || \ defined(CONFIG_VIRT_CPU_ACCOUNTING_GEN) just use __maybe_unused for this small function which seems like a good trade-off. Signed-off-by: Qian Cai --- kernel/sched/cputime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index cff3e656566d..85da4d6dee24 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -252,7 +252,7 @@ static __always_inline u64 steal_account_process_time(u64 maxtime) /* * Account how much elapsed time was spent in steal, irq, or softirq time. */ -static inline u64 account_other_time(u64 max) +static inline __maybe_unused u64 account_other_time(u64 max) { u64 accounted; -- 1.8.3.1