Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3351100pxa; Tue, 18 Aug 2020 13:01:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFu/j2gKGfaHX21lE3kX94PHLFeq/slc55Ij7IKWj3r2PvQ8eHLyPb0w8XxzOf++Gmnsuz X-Received: by 2002:a05:6402:c85:: with SMTP id cm5mr21854282edb.350.1597780883438; Tue, 18 Aug 2020 13:01:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597780883; cv=none; d=google.com; s=arc-20160816; b=hCnWFLw240TBWufY+VMjdKpt081pL9xKcr1Fzxbz6aBmcBCrf2AI/U6Qmvbxa/jziE 3XovdhT7gj6N8NqXSQ5Yyo1TBiFmh/MfiLdu76skbtPa9r3NrEmrBkYAGDYAEmxSpVxF yBExiPsJc/4ZjbdfNVdCBc28o0QhVJ6qeYM92kjaw/G+y8nxJD6aXZfqObieA25iUcMn szaNfCO2hC2knVlj4ofwjaKuILtmQwU8yxNF6ASDOHt1GyeU5RqoGBHh6artsnHv0u2X Snk4CFkP33v70AmLXNkfBfwQYSomRQZcu/Gu/4QtF4LgGJjxihKGez38S6xuFrFbcieM B7+g== 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:date:from :dkim-signature; bh=7Z4r92eghHfjUZjZIQSRYab2MsQQwQr8sHxL2zxeLTw=; b=aXNJ4BHu6GyAQ4ZT1EM947qh1TeNiqHWhVYguWcoA9x5eN9WkKe3jdw2/zRFqYM2RN PZdN+rv6gr90A73BXuJB+mU5r1TvsUAKYc5kMZ4b+ciz4Cf/R/e1yAioj+tCJ/DuhUql cy4kMu98vDQoHeGpuumIRNHdPZ6lVGClM+zT/J/qO7awTzvPoZs1CFyTNQLgqqsLYX/X 6V91yZtJRnsPJd2kVKBIoMOx8hWVI9UEnr69zyTB5HtmMDCB4Wt547OmWfEu/3TKu68H LMwUhsjBvzBy29vgzc9wmBoI8/5fmtr1/vT1qdEEXel7ScUB9wtC52s40Um2Ut4MMux1 8u7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BX341iTD; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w15si17289940edl.118.2020.08.18.13.00.59; Tue, 18 Aug 2020 13:01:23 -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=@gmail.com header.s=20161025 header.b=BX341iTD; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726702AbgHRT5x (ORCPT + 99 others); Tue, 18 Aug 2020 15:57:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726632AbgHRT5v (ORCPT ); Tue, 18 Aug 2020 15:57:51 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3189C061389 for ; Tue, 18 Aug 2020 12:57:50 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id g8so64579wmk.3 for ; Tue, 18 Aug 2020 12:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=7Z4r92eghHfjUZjZIQSRYab2MsQQwQr8sHxL2zxeLTw=; b=BX341iTDG5bRb5HoTnI6iaCWsPcD3AfZMdu+o9syAc3cWp7zDhqrq6S0FEbQE35Ak7 1AVv0UqL21mbXs19iIuQRxBivn+cldL27DushF3v1X98OPaQmy9lF7fx0kKnCo4HBI8U WsiDKURPJwT+e7Gmpx1YFXT9bvbvwpUv0RlK1bDy0nPyYELkGt3/zF6R87Bp5wZHQAwZ 9TuhHtFpi6JvjZB/DLz29zY/NCXQPGWVLOjtIMD1kH5oyl0+trVjRN/ktuktHgmN9ZI8 CEnd5BzbGkx7GLnpAXykw1WvO092BuPY3AGQz/9v0QvYyl1daG+EWHmrZUG6Kg+sSOAF 4Xaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7Z4r92eghHfjUZjZIQSRYab2MsQQwQr8sHxL2zxeLTw=; b=PbFIP/WZncePvzvJFBxH0QnBGy3O1JYCC4l4BPHn56mmYF/aiN2eywPYFTOfUpmIcX 5MsWGRqq08ci0O/6xF5v5o2XRZTaivNz7drvcIG6Y4h11g/KZ3vmLW0gRcCGf2aBOO6U RVWXcJ4pwlEFl3E92ueYCgd9Mk0VP4Wpnzmc5huRxtjUyat8rBlg9RvJ0TmEf0ydvIyv SkGR8oEb14NS447SHBLzkg5VLizBjvbrkIGdRWhwaGwQrAn7Zt209/moNhay/dDfWnMn doElkn6CxCl5HVl9Wk2d2QYZLqcsdiNF22+w3JgxVNoqdnxrSnSCvyqaAnAU34wrzMIZ FrDA== X-Gm-Message-State: AOAM530mQ2yOnnx45K4Y8IB5mT2gkXqT0/lEvYoOpIXu6dFNBoVpAc6A JKqmk94qNfB7ysAJHinzbEg= X-Received: by 2002:a1c:720d:: with SMTP id n13mr1412706wmc.103.1597780669429; Tue, 18 Aug 2020 12:57:49 -0700 (PDT) Received: from medion (cpc83661-brig20-2-0-cust443.3-3.cable.virginm.net. [82.28.105.188]) by smtp.gmail.com with ESMTPSA id z15sm37289369wrn.89.2020.08.18.12.57.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2020 12:57:48 -0700 (PDT) From: Alex Dewar X-Google-Original-From: Alex Dewar Date: Tue, 18 Aug 2020 20:57:46 +0100 To: Nick Desaulniers Cc: Alex Dewar , Ingo Molnar , Peter Zijlstra , 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: <20200818195746.scpjm3dlg7cfst53@medion> References: <20200818170337.805624-1-alex.dewar90@gmail.com> 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 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. > > > > > 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