From patchwork Tue May 5 14:07:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11529249 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 146F81392 for ; Tue, 5 May 2020 14:08:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 06D072073B for ; Tue, 5 May 2020 14:08:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729198AbgEEOH4 (ORCPT ); Tue, 5 May 2020 10:07:56 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:58365 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727857AbgEEOHz (ORCPT ); Tue, 5 May 2020 10:07:55 -0400 Received: from localhost.localdomain ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.145]) with ESMTPA (Nemesis) id 1MSckp-1jgbDd2wEj-00SzC5; Tue, 05 May 2020 16:07:36 +0200 From: Arnd Bergmann To: Luis Chamberlain , Kees Cook , Iurii Zaikin , Alexei Starovoitov , Daniel Borkmann , Song Liu Cc: Arnd Bergmann , Martin KaFai Lau , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , Andrew Morton , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH] sysctl: fix unused function warning Date: Tue, 5 May 2020 16:07:12 +0200 Message-Id: <20200505140734.503701-1-arnd@arndb.de> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:3d2w6o/Pc8jpk4E6dFIe0waqDAGYBBiltl8xwm05XKzTS/tzFZH wM6QVpdygqilv5m8jqAn3iINx2PgvGXlxHuW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kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org The newly added bpf_stats_handler function has the wrong #ifdef check around it, leading to an unused-function warning when CONFIG_SYSCTL is disabled: kernel/sysctl.c:205:12: error: unused function 'bpf_stats_handler' [-Werror,-Wunused-function] static int bpf_stats_handler(struct ctl_table *table, int write, Fix the check to match the reference. Fixes: d46edd671a14 ("bpf: Sharing bpf runtime stats with BPF_ENABLE_STATS") Signed-off-by: Arnd Bergmann Acked-by: Martin KaFai Lau Reviewed-by: Luis Chamberlain Acked-by: Song Liu --- kernel/sysctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 86ed5dd29a61..3b0cecf57e79 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -201,7 +201,7 @@ static int max_extfrag_threshold = 1000; #endif /* CONFIG_SYSCTL */ -#ifdef CONFIG_BPF_SYSCALL +#if defined(CONFIG_BPF_SYSCALL) && defined(CONFIG_SYSCTL) static int bpf_stats_handler(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos)