Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3353898pxa; Tue, 18 Aug 2020 13:05:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0XMaQEyANBCaDFK/fVnOnTY7hCRtpoX2FTB60h0qPRvyYffmLROFbOgTHC936pUpA4dGo X-Received: by 2002:a05:6402:2033:: with SMTP id ay19mr21238601edb.361.1597781158520; Tue, 18 Aug 2020 13:05:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597781158; cv=none; d=google.com; s=arc-20160816; b=Mu0aQboM3y/hPIOogPxCXC7X6jCp0Hcp/6gAQhwJFWaJI8i4k9atnzwXLMsEfDa8UZ iShGwUbeVei8SX9Rm433k+KhBFwJUnfZH/m75ZYjd0FreLL6vfQVJ0G0BWiPcGzuwp5i wYuMfjkTrGnNx9hFV4WQ6y2TYsQpAZdQcc9Q8EpVoREhNNpy9ZGj9WqXD6fph4EBbjjg MkXUtyvPDDxo0w2exqKi4FfypgDa3sJ9VXu2qQOywa9CGVwIh4guKc264wjj5cAtnbpn cqkwTHXTrj77tN/KGLp0JJ7rM4TsuEx6w1eSfhbDq8HvMX163Z7e1L6/dr46E6CfFZMF b8wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=bYlwdkpiQ5r4IlzlVf3XVoN723S4ZkSGimNU1q1QEv0=; b=wVgGIW5Ea/8N3f+8R+plzUiUCv1cMZyHV4u0/cbP6E9AyvUUXxul16xqUevOUPcL4S AFNuemIEft7Z0Du9fwNsfgZpZnSdpsxyAkkmKt8otrq50jckcoU2Pd3H6+/CZVQPR/+1 zOxYYFua/EEu7k9O6f3MNB8JVhnZrjkRsnijewy+mPNS9xh3g8FiAwduaLlrdH1ERp2q fMkY6nRBiydP9nALzNrF87oAwxSku0sMBRG4aqf8fRy9hZfpUwrO15bI26xDO0jacHrt dX3vUM0Ie76tsQzFaqsU9DjF82vFGuNGAvOeVgRaXXoks11txDmdM0p5QY2iu/6vj5fd 0uTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gsHA1THP; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si15300211edi.15.2020.08.18.13.05.33; Tue, 18 Aug 2020 13:05:58 -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=pass header.i=@google.com header.s=20161025 header.b=gsHA1THP; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726728AbgHRUCj (ORCPT + 99 others); Tue, 18 Aug 2020 16:02:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbgHRUCi (ORCPT ); Tue, 18 Aug 2020 16:02:38 -0400 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2637EC061389 for ; Tue, 18 Aug 2020 13:02:38 -0700 (PDT) Received: by mail-pf1-x443.google.com with SMTP id a79so10490623pfa.8 for ; Tue, 18 Aug 2020 13:02:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bYlwdkpiQ5r4IlzlVf3XVoN723S4ZkSGimNU1q1QEv0=; b=gsHA1THPb/jhzoRgTkhXbdFHQ3FHcjNQAPRUKS/MaQ4nboOSjfI9LbBjaXtjZdJzFL xlU2vWhoF8kgNISJazpoRzdaNGsgfPQg6Yjx65HbYR6Dmsd+ecCk7IPaipIiP67qLAfG XqeuVNWJkBCPr560f2sHEsnsUr6Pnd31OHyqSr2YBv+2AwDT+YybLF+1XD/osm4kYdq5 KPVzmFMbUTZRQQDYLlzb4ywSBxkA+pPUDQrlGCytu8P2i21obLr6h/WxVyuXgCz7vURN rWPj87bg7bZkOWcVWbydJwVRtxY2WH2J6t6OsY3IkiMa2OJXvYtjVjUnaYfsnG09tWuB xChg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bYlwdkpiQ5r4IlzlVf3XVoN723S4ZkSGimNU1q1QEv0=; b=phJbsFb6eTYhwXco+AxsZ8R3Thz/2LuvRcI/TbaktV6dZwr45BCc104jnA35xhoJ3B RopwVLQE2y1bKYnYxWMR4u3kfm7ou60+pelctVT++DKDuPGFLz1BEPMsr+8vj6SsOhYo +cbWOb5F7OCdKmwtuoLZocwcsYn8cleCLPafdS/kC1YL0wjDT8c2DJ7mlbDBOUYxFMmp 4S794nkBTvkEmtRDx/rD+X1TBmSZd91JYX1HtClSfV41cVn7dK4NywJzWa93kI/QaZGm ndpD0K5uJ3mz0+MgwcUzAuw6QxtvHChnp9YljmHxZnUCPg8lr0foN1bd03qcZ4NWnpI3 v7nQ== X-Gm-Message-State: AOAM5333P7ZSC19k5esUiONNtJhgnfwdxdWVFI5pRXsq5eC9kG4vGHkK mM2vi6KBRQz9rryIwOgHWcXBXHICuLfKJA83jzpFRQ== X-Received: by 2002:aa7:96e5:: with SMTP id i5mr13565872pfq.108.1597780957364; Tue, 18 Aug 2020 13:02:37 -0700 (PDT) MIME-Version: 1.0 References: <20200818170337.805624-1-alex.dewar90@gmail.com> <20200818195746.scpjm3dlg7cfst53@medion> In-Reply-To: <20200818195746.scpjm3dlg7cfst53@medion> From: Nick Desaulniers Date: Tue, 18 Aug 2020 13:02:26 -0700 Message-ID: Subject: Re: [PATCH] sched/cputime: Mark function as __maybe_unused To: Alex Dewar Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , LKML , clang-built-linux Content-Type: text/plain; charset="UTF-8" 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 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. 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 -- Thanks, ~Nick Desaulniers