Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5943989pxb; Mon, 14 Feb 2022 11:18:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxL74E6nhc4k2F1Gt/utquxmy0XGo14M+QRkOqi2UTc9gZ5glcz57iy4v4gD+MgDivoTmZC X-Received: by 2002:a17:90b:33cb:b0:1b9:fa5a:1d7d with SMTP id lk11-20020a17090b33cb00b001b9fa5a1d7dmr82309pjb.103.1644866321276; Mon, 14 Feb 2022 11:18:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644866321; cv=none; d=google.com; s=arc-20160816; b=m2oWVJykwPpQAh0qBEozYDy9SeI+OXjS0dXGHyUkdsbqYZGhs3GtgZRt+Q9kXsKqfR j4OQKvAr/2iX4RCAPVRFmOgCQAEV2UbILAxeCoyi9uNUaiYv/Ii1IAAqRrWfLCUsjgZg AtjQHTU4FPpM7LNlV/6AP9yT8hYKHWHQgYYovOn85FcSlAbKa0JpotoL+DS/0bmG7CI3 ODgxYMg8CQzKtcEmVKTBEabikTJIyROi9AjOqP7WVtrsvL3ftJm7eh6PPuQ3vhTydqAS 37p3uVSj47TS4FU+m8iZ0fD0geWmVlK6yrTo186Udkh0FS5rebSzDyMBRPUsozT2rTv+ LsNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=IWFhsdLGwPufdKVvo3WtqAatdIfuhannZRdJWn555Yc=; b=zNZIpYxL6Q7AALeaLuuQITrh4/QI7G+VbmUg15WtYO0jEAu3IwbHubo5H74LzzF7fS jXKM9InL1K2brSey3wgFn/ufCkLVopBTVIYv1SlBXuuouxPavFUnIVUFPpLnupI+hBq7 3+j9fnmolXKi4YdV/1LkwtR4AnfbcwiGdr+TrNHFJqyZ43jwxBMbU9Ya48+aCnXxoN7t xZvNdpEmfgoY7qpkky/eA6Nm+LdC9C2kJVzcqWZEnLIXY1T4dKh46/EZDh37mcTpI7VE hEgN2UmS3ZU/zW9A+LeUZuUydham1GA8+Lp57Jr7PHQn1eijl1ebbFLGgL6wNK8kgfvn 7dzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=0RL0kBfq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 191si532633pgc.161.2022.02.14.11.18.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 11:18:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=0RL0kBfq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 27210B45B6; Mon, 14 Feb 2022 11:10:49 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353884AbiBNQaN (ORCPT + 99 others); Mon, 14 Feb 2022 11:30:13 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356371AbiBNQaL (ORCPT ); Mon, 14 Feb 2022 11:30:11 -0500 Received: from conssluserg-02.nifty.com (conssluserg-02.nifty.com [210.131.2.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A1FD60D8C for ; Mon, 14 Feb 2022 08:30:00 -0800 (PST) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (authenticated) by conssluserg-02.nifty.com with ESMTP id 21EGTW6Y031027 for ; Tue, 15 Feb 2022 01:29:33 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 21EGTW6Y031027 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1644856173; bh=IWFhsdLGwPufdKVvo3WtqAatdIfuhannZRdJWn555Yc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=0RL0kBfqbzxPVKxJsQmPwNvCEGIW6HXB5/mG6rgnadphGLGCNmiF979icb3eyhSlw zhd+Ajsyry0nmjFDJ5KYk/VSo8fm+5BcPST4bAiuSThsrPOugH8vZtQ2sZ5SNq/Jvv 9dJ1JbXnAdt7Bs0AaUi1Ea3smhMstSFa3SQz5rfG74ZA83SSu03139HrEUwU6GvvVf Okm3zu3HajctHMS+sllWtiOdwpnz4mkp57FByXL+cZrn240xkk18guwWzAqZigNck3 fEllsOEIvTNelwvvJCFqVq6ZHSGnfwHUiqWTqVxfKghN5EVcQ/BzKSDsctdSYCDIZj 24DgzK48EHr/A== X-Nifty-SrcIP: [209.85.216.54] Received: by mail-pj1-f54.google.com with SMTP id v13-20020a17090ac90d00b001b87bc106bdso19336754pjt.4 for ; Mon, 14 Feb 2022 08:29:33 -0800 (PST) X-Gm-Message-State: AOAM532RUQcI4V+qwkCm9hiwFwXv8geRyirlGwKC936tzDDKkpc2LJoi ezmoe6R0UDYWOQGpewPUgAv4EORIlPaPA3+zS6s= X-Received: by 2002:a17:903:22c5:: with SMTP id y5mr498336plg.99.1644856172109; Mon, 14 Feb 2022 08:29:32 -0800 (PST) MIME-Version: 1.0 References: <202202132037.4aN017dU-lkp@intel.com> <20220214102000.1d3af66e@gandalf.local.home> In-Reply-To: From: Masahiro Yamada Date: Tue, 15 Feb 2022 01:28:53 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: kernel/trace/ftrace.c:7157:20: error: unused function 'ftrace_startup_enable' To: Nathan Chancellor Cc: Steven Rostedt , kernel test robot , chongjiapeng , llvm@lists.linux.dev, kbuild-all@lists.01.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 15, 2022 at 12:53 AM Nathan Chancellor wrote: > > Hi Steve, > > On Mon, Feb 14, 2022 at 10:20:00AM -0500, Steven Rostedt wrote: > > On Sun, 13 Feb 2022 21:03:29 +0800 > > kernel test robot wrote: > > > > > All errors (new ones prefixed by >>): > > > > > > >> kernel/trace/ftrace.c:7157:20: error: unused function 'ftrace_startup_enable' [-Werror,-Wunused-function] > > > static inline void ftrace_startup_enable(int command) { } > > > ^ > > > 1 error generated. > > > > Strange. I always thought that static inline functions do not cause > > warnings when not used? Especially, since they are often in headers when > > things are turned off. Or is it because this is in a C file? > > With -Wunused-function, clang will warn about unused static inline > functions within a .c file (but not .h), whereas GCC will not warn for > either. The unused attribute was added to the definition of inline to > make clang's behavior match GCC's. > > > Is this a new warning caused by a commit, or is it a new warning because > > the compiler now complains about it? > > However, in commit 6863f5643dd7 ("kbuild: allow Clang to find unused > static inline functions for W=1 build"), Masahiro made it so that the > unused attribute does not get added at W=1 so that instances of unused > static inline functions can be caught and eliminated (or put into use, > if the function should have been used), hence this report. BTW, my hope was to move this warning to W=0 someday. (that is, remove __inline_maybe_unused entirely). I do not know how many warnings are still remaining, though. Is it now more difficult due to CONFIG_WERROR? > I will be honest, I don't know why the robot flagged 172f7ba9772c as the > commit that introduced this warning but it seems legitimate if > CONFIG_DYNAMIC_FTRACE is not enabled, since ftrace_startup_enable() is > only ever used within an '#ifdef CONFIG_DYNAMIC_FTRACE' block so I guess > the stub is unnecessary? > > Cheers, > Nathan -- Best Regards Masahiro Yamada