Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp277917pxa; Wed, 19 Aug 2020 00:34:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsTucCNbuEC6YLoyoj03o1uwyEg6cu1K+1n/6hrvu304PxTSkb4hDP7+ip/Zvi3Fpwdfuw X-Received: by 2002:a17:906:bccf:: with SMTP id lw15mr25064725ejb.415.1597822455641; Wed, 19 Aug 2020 00:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597822455; cv=none; d=google.com; s=arc-20160816; b=qScf7NauyLBtr81ZoGl9afNhG3QIPg4K2MQQqcvqb9zy7FUztPek7kap1vGN5XcDXk yxYxemKebAQXmfifCIAvai+uAKuEcMryKsXlzUcHVLQ8qKe1M9DQY/zEJvmfCJ/bWETn j6brtLfTtTMPW17EPYC/MKZG662baH1wj6fXhxHpvAJiy3C9SvfiCGgUhgs2Y8qck3Wu 79nYhW17Arpvnz5BVtW2fJHHSKC5RNSSaXPQb+woDwcAldLEpAR+2RQuRjxo5B8MdSRc OOFIpe+k9/GSmuzdczGu0R9XwIstbztV9nO0k1YbiUv24qhPnDqLWd1GuqcJr/njqXjo WD0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=kL7Gy3l7twO0D8ptMuadg/doUyMGt2vPrUvqyXCwPw8=; b=MMid9DVJCLwFLefAL7bv2c/TZ+9xkLsnd6+QKrzN6kGC6pja58zGWYv+C/3m3zLlzP +sE5/mk6RdE8HTjM79TjtQD0hxeAhq9rdEiUhD3Wk7bt81KT9QahC6FE/UR3XWEkLQSm aOScaOMTXDDCDB31FjI+bbqTa8BSmnsRcIdAt88B/hBaAXNSUK72WryWY4XY4Kemp6eu yvVCKsYmmGlHYsVSyTHVup3+37wX9efSofeJ8ZVvZp9+eM32obFDutPgqA3wD5AHCWH8 KBTSNys5VWCMH/WGew0hGoMfR96wo7SRVwU/d3otvD4AIZWpQV8fShAVGEuyzdNEKZOl i27Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=eNOHhxxy; 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 y10si14924061edu.397.2020.08.19.00.33.52; Wed, 19 Aug 2020 00:34:15 -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; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=eNOHhxxy; 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 S1726929AbgHSHdS (ORCPT + 99 others); Wed, 19 Aug 2020 03:33:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726630AbgHSHdS (ORCPT ); Wed, 19 Aug 2020 03:33:18 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E865EC061389 for ; Wed, 19 Aug 2020 00:33:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=kL7Gy3l7twO0D8ptMuadg/doUyMGt2vPrUvqyXCwPw8=; b=eNOHhxxyLZrugshdJbYPUtuTMS r0a5RcmYbofB+vlliEEwViJsDb9UzyUMZ2VelSJ5QR/piQexaidM3b7ncK5AgSg8E/VznQaVgELJr +ikQpGI71NU9rl2+Awv+HyxOZwxAiTk/CTcsPsub+8ey+fJABxXBCg/vROM43C/XpptlZgh5hRp10 WVJvm/yOP+ihmjl+RyqmmrGZLMQJE31Sx39iWjCAO1RRXTeryUQgwZl9DPBQySsoIcmSQrg4lUrYV PSNGUsN5FMbNmO0rK93pNKRh2HS9mYViccnfX/TPnlLRuuosWzwj6cPC4jXz7aUWac7bCoGZfl73t yEXJmyig==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8Iaf-0003t3-B2; Wed, 19 Aug 2020 07:32:57 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 080F3301179; Wed, 19 Aug 2020 09:32:53 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C476821A87267; Wed, 19 Aug 2020 09:32:53 +0200 (CEST) Date: Wed, 19 Aug 2020 09:32:53 +0200 From: peterz@infradead.org To: Nick Desaulniers Cc: Alex Dewar , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , LKML , clang-built-linux Subject: Re: [PATCH] sched/cputime: Mark function as __maybe_unused Message-ID: <20200819073253.GV2674@hirez.programming.kicks-ass.net> References: <20200818170337.805624-1-alex.dewar90@gmail.com> <20200818195746.scpjm3dlg7cfst53@medion> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 18, 2020 at 01:02:26PM -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. Urgh, also, I have vague memories that we made it 'static inline' to avoid all this. Should we instead mark it __always_inline ? Also; I detest the placement of __maybe_unused, it is not a return value, but a git-grep showed me it is wide-spread :/