From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3EEDC43381 for ; Mon, 4 Mar 2019 20:47:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF39820830 for ; Mon, 4 Mar 2019 20:47:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="QX+XERJp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726412AbfCDUrr (ORCPT ); Mon, 4 Mar 2019 15:47:47 -0500 Received: from mail-vk1-f193.google.com ([209.85.221.193]:41650 "EHLO mail-vk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726061AbfCDUrp (ORCPT ); Mon, 4 Mar 2019 15:47:45 -0500 Received: by mail-vk1-f193.google.com with SMTP id b6so1442745vkf.8 for ; Mon, 04 Mar 2019 12:47:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+8mwHyTQD3viibZhlwqMBx4el6lQf1vUm4nyYwj8u4Q=; b=QX+XERJpa12NN7BG83hwaLrRmRKeSTj/iLPZ5Rvc3NZtHb0XWTH2x5Z0t2+rsxKlU9 iNMVpLkRMTYeiVTK0Tu8anwvPVL97EYa/4fvIQA9lX5LAcva8M4D8i4m63Nv0fE6Dl0B YEsd+8SbGlgiC+DdawHMX8+0BWFfldL2AYZbY= 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=+8mwHyTQD3viibZhlwqMBx4el6lQf1vUm4nyYwj8u4Q=; b=NC3RVLxa+gjBRK+jer+HsAWakVuAg1xQUb4GCdqDcZkMd5Rc+CHiBKsB2HtZwvlop8 vH5b4gh89yuQdfOJburW4wiEvDyCPRwkGBq0M5kNbrWp4zB+FtFC7HQpXSKA7pZ2+ASm vih/o4CGNA+Q53TWRLDKQuDpmOAzVe2IYGqyGTZFU7VRfMwtXpXcEZ1aVNsARI51UfbG hULHDg6v7tk51m7Z5bLL6mCG+40/FAUpO/fJUyUcFYHGgKK0Mhz7Tu+jVfKuPcu9nG9y cPFRgz5tEki8z3gsGh50LiCvVaOIJnusHCyAE9PsGXy6/u85iv70ejflcZ5ii5BDE1lq x/Fw== X-Gm-Message-State: APjAAAWzT16iX3hmQoYhjN03uBQC5h/TbVWUcM9V6ldr2zVMI4Qi6+Lm NRlgXUH1dLnfTXbl2TTSZ0JgYg1chXE= X-Google-Smtp-Source: APXvYqwwoOpOVsbMErIqnHlhb/GWOSFpc7fZxeRseZDhbI7M1HS8C/xa1UggJxbjGWRlmGCLcHjGpw== X-Received: by 2002:a1f:e981:: with SMTP id g123mr11223997vkh.18.1551732464010; Mon, 04 Mar 2019 12:47:44 -0800 (PST) Received: from mail-ua1-f41.google.com (mail-ua1-f41.google.com. [209.85.222.41]) by smtp.gmail.com with ESMTPSA id c6sm4446933vkf.45.2019.03.04.12.47.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Mar 2019 12:47:43 -0800 (PST) Received: by mail-ua1-f41.google.com with SMTP id q17so5690205uam.0 for ; Mon, 04 Mar 2019 12:47:42 -0800 (PST) X-Received: by 2002:a05:6102:d2:: with SMTP id u18mr10635494vsp.172.1551732462335; Mon, 04 Mar 2019 12:47:42 -0800 (PST) MIME-Version: 1.0 References: <20190304203443.1992942-1-arnd@arndb.de> In-Reply-To: <20190304203443.1992942-1-arnd@arndb.de> From: Kees Cook Date: Mon, 4 Mar 2019 12:47:31 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] bpf: fix sysctl.c warning To: Arnd Bergmann Cc: Luis Chamberlain , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrew Morton , Christian Brauner , LKML , "linux-fsdevel@vger.kernel.org" , Network Development , bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, Mar 4, 2019 at 12:34 PM Arnd Bergmann wrote: > > 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 -Kees > --- > 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) > -- > 2.20.0 > -- Kees Cook