Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3365510pxa; Tue, 18 Aug 2020 13:27:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/EH2ztre6kkz+ScgYBWY7Msc8InE5sjm9iWCBX1uaapcf122+Fwl9TxpHQinG8MNwXYGl X-Received: by 2002:aa7:cccb:: with SMTP id y11mr12438703edt.15.1597782455302; Tue, 18 Aug 2020 13:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597782455; cv=none; d=google.com; s=arc-20160816; b=e+8KLsY4S1U2Hc3MjN2D96yooNdUG1RuI2q0kQy02OLKCz3bpIDJMZEN5H6xLtko0U yalecm8HPem0joxZkHmmotorwi7UhijvQag0dShojdo87qKTTQ462UlhK2N+JZ1wk87k B09+HoIbxVIZeY8WUb3ETD/NCuF7//dabDHin8EK3ajLMTc7gW98uQpxfA8GMH1AbNAr o4N/Xnpt479XXsqg6/F+so65aMzyopQbb0d8HYgQPayJTqeykJGv+hDO8De4b0w8IB65 KCOGuSJue4xqs2KobeYjOKPcwPvCwe0lUcFDqIvROqSlTLhjoIEH7VmxM5sG2ljMUj9T GzKQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=NSefHjcXX+xAM2zdHdMGcWlh6MN4FiTr44VXNHhIJKc=; b=o9Lf0GMoF/skvs+dgnFAVR405xSOhvJN2QquWgIUykbgKVSLEfmuaB558/HW4QiCm1 2Yp33lzjg1DUNh8HfKqrYe1UaP1eYG8DLOQdyVbZJ3etoLu10sfKWIzCqdbXFeYRJU3E v0uNP0D5yxcs4lf6U8+L+y2XTbKR5R2Ac/AHTuwHjXhMuKj1NUEEId2xheey7Pwr6iE2 U7o53/G8Wz8vgdMcyQhOB0P++EVn4E4Guv1MalVYg6q9Xio7Vnpdle6NBoF3SWhj505+ kJAqbio4BqiA+A3CQMB1Yz2lODl+DGj3Pi1Ga/qdVkss1Ie4ZV8ncG9BL9wW9pF5MIgp N5HQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id do5si17749394ejc.612.2020.08.18.13.27.02; Tue, 18 Aug 2020 13:27:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726552AbgHRUUd (ORCPT + 99 others); Tue, 18 Aug 2020 16:20:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:35898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725554AbgHRUUc (ORCPT ); Tue, 18 Aug 2020 16:20:32 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 614D1206B5; Tue, 18 Aug 2020 20:20:31 +0000 (UTC) Date: Tue, 18 Aug 2020 16:20:29 -0400 From: Steven Rostedt To: Nick Desaulniers Cc: Alex Dewar , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , LKML , clang-built-linux Subject: Re: [PATCH] sched/cputime: Mark function as __maybe_unused Message-ID: <20200818162029.1692fc82@oasis.local.home> In-Reply-To: References: <20200818170337.805624-1-alex.dewar90@gmail.com> <20200818195746.scpjm3dlg7cfst53@medion> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 18 Aug 2020 13:02:26 -0700 Nick Desaulniers wrote: > On Tue, Aug 18, 2020 at 12:57 PM Alex Dewar wrote: > > > > On Tue, Aug 18, 2020 at 11:13:10AM -0700, Nick Desaulniers wrote: > > > On Tue, Aug 18, 2020 at 10:04 AM Alex Dewar wrote: > > > > > > > > Depending on config options, account_other_time() may not be called > > > > anywhere. Add __maybe_unused flag to fix clang warning. > > > > > > Just curious, would moving this definition to be within an existing > > > preprocessor guard for a particular config also fix the issue? If so, > > > prefer that. If not, __maybe_unused is the way to go. > > > > I don't think that'd work here: it's used within an "#ifdef > > CONFIG_IRQ_TIME_ACCOUNTING" block and a separate "#ifdef > > CONFIG_VIRT_CPU_ACCOUNTING_GEN" one. We could do: > > #if defined(CONFIG_IRQ_TIME_ACCOUNTING) || > > defined(CONFIG_VIRT_CPU_ACCOUNTING) > > ... > > ... but that might be a bit ugly. > > Yeah, ok, in that case it's fine. One issue with __maybe_unused is > that this function will stick around forever if all call sites get > removed. But when the preprocessor checks start getting hairy, > __maybe_unused is maybe simpler. For the reasons you state above, I'm almost thinking ugly may be better. :-/ But there's other places that have the "maybe_unused" in the scheduler code for basically the same reasons, thus I guess it's OK. Acked-by: Steven Rostedt (VMware) -- Steve > Acked-by: Nick Desaulniers > > > > > > > > > > > > > > Signed-off-by: Alex Dewar > > > > --- > > > > 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 5a55d2300452..43ede0d6661c 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 u64 __maybe_unused account_other_time(u64 max) > > > > { > > > > u64 accounted; > > > > > > > > -- > > > > 2.28.0 > > > > > > > > -- > > > > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > > > > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > > > > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20200818170337.805624-1-alex.dewar90%40gmail.com. > > > > > > > > > > > > -- > > > Thanks, > > > ~Nick Desaulniers > > >