From patchwork Mon Mar 4 20:34:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10838583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0457414DE for ; Mon, 4 Mar 2019 20:35:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4CB62AAC9 for ; Mon, 4 Mar 2019 20:35:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8ABE2AB46; Mon, 4 Mar 2019 20:35:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7991C2AAC9 for ; Mon, 4 Mar 2019 20:35:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726672AbfCDUfN (ORCPT ); Mon, 4 Mar 2019 15:35:13 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:38375 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726076AbfCDUfM (ORCPT ); Mon, 4 Mar 2019 15:35:12 -0500 Received: from wuerfel.lan ([109.192.41.194]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPA (Nemesis) id 1MyK9U-1hAkY524SK-00yii8; Mon, 04 Mar 2019 21:34:45 +0100 From: Arnd Bergmann To: Luis Chamberlain , Kees Cook , Alexei Starovoitov , Daniel Borkmann Cc: Arnd Bergmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrew Morton , Christian Brauner , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH] bpf: fix sysctl.c warning Date: Mon, 4 Mar 2019 21:34:12 +0100 Message-Id: <20190304203443.1992942-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:lhdSW1MClS1OpT/SWuhIIv9Ek1tpe8udolndjPd+QDzE4nvOEE4 VI7bNGQYGB7yiZvLnjw7IcBi0aAAGjcRT2euQFwRQ0yrJRhghqUUJnHCmBwsHseRgYOtjdq hEhhnNvgb759fnPkBNdCEc+b6u434vmPbw9O2Gi/x63fpZhbWBu4KhgpT1/gMX4IqX9UF6o rv12ftNNH/Ko1YjohTTcg== X-UI-Out-Filterresults: notjunk:1;V03:K0:HshwpxYVGpA=:WWCNSSTL2KpTZHzuwghHl7 MnaEnbAiqK6dVJwcWhA/IjbiUF4KcQHwGS3VlBUH1fjshRRqE3aWfsn2d+5wvHK46s9mNZY+8 45z/0WyENHrsG0ZL+/zeJ3YuReB8ucI2vZu+47eWYeYiJukSiEZmr8NxKCMFbZ+NrcYZUvJOJ +O1FAnsSpSFiZRhrSVLaYvwvwSLIb3HbsI/8OXCHJtHwE3Tcx/c2FBHIVxgmwu3GJYkX1X/DT 3rDBbH8tpubU6L6YtYe95lRauw7tFde2TxbsZTSSEI4ySdWgS8c0ixpW/rB130BRFXmrsO2uv yCqZSgj1tilLNu7SNmOiTYAo9ZxSVW0gtnMv8s7fIP+n0/zg4umJdgr6eJess18i0+wgdwIZS bcf4R4pGkb32ODlZ/VfY/TblDRXAJnNvwLyCkjQNfv6kejAZur4RdREVDFNPLermLxX9iAXup mqRFjgYYxxkeJD5ptuW99iORYrswc8TpFEEwJyheTH9MG+PkTG/Sh9sb+n+kL22Im5yZVhYZy ZzyNEZl9nC8z+py8TJnXrQRXbIhC1vrz40aVC+4Bb8/GyY/DAJI6mf9VlBX/WDTBKuUrdnJhq pCIUHx8wYWYl6Pr7gtl79xdJXzBHGuhEihiBH49wzJ0OspvOmcZG8J5uRgocZTyfVPhD6yp6l DXRHbFsOagKedTB//mdOGStu0ZlYHSOqPbBAJDGRnwa+6z9OrVMn9Obww0wz2A0iwgXuZp7Df h/j98kKOAYv8o4LyomCigazFf3gY+VVBsHNMIA== Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When CONFIG_BPF_SYSCALL or CONFIG_SYSCTL is disabled, we get a warning about an unused function: kernel/sysctl.c:3331:12: error: 'proc_dointvec_minmax_bpf_stats' defined but not used [-Werror=unused-function] static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write, The CONFIG_BPF_SYSCALL check was already handled, but the SYSCTL check is needed on top. Fixes: 492ecee892c2 ("bpf: enable program stats") Signed-off-by: Arnd Bergmann Reviewed-by: Kees Cook Reviewed-by: Christian Brauner 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 46a0d0a14a66..b3df3ab7ac28 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -3330,7 +3330,7 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, #endif /* CONFIG_PROC_SYSCTL */ -#ifdef CONFIG_BPF_SYSCALL +#if defined(CONFIG_BPF_SYSCALL) && defined(CONFIG_SYSCTL) static int proc_dointvec_minmax_bpf_stats(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos)