Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2736501imb; Mon, 4 Mar 2019 12:48:43 -0800 (PST) X-Google-Smtp-Source: APXvYqxN5iTe+Na7JqPNIRDTXZDVaZeTEeVC0fZ7a5CwH4PNXjfTOyxaOZaFgrxMkopWRnUwcSwx X-Received: by 2002:a63:d442:: with SMTP id i2mr20085407pgj.246.1551732522963; Mon, 04 Mar 2019 12:48:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551732522; cv=none; d=google.com; s=arc-20160816; b=xqOVTsPl1Xqf5tj6QR/yCZKLjXzmzr26J4BhYbU2gxjJjPXfrE+uL5z1acvmCKP9oO BZDEUQGd/fZN7giPZ8ox1nHyLOnVg+ShWHo/cuhDmsuhTUFudjzBk74KNbNmoJFOJrA0 q5aZ0m1AreNMlP2bE4mSMCq4KzYuGKvFwoJrCGFezpDoSZXZgO/SJ8QitaG7zS6NV8aW mmjN167/bWLGJfCUk9FK4zrsGLmtkFeuAA6DR+oW0M0JCEBeFffPm+4/oTtgjvDvWmv6 OsFtlnt2awEcWRZEgm8vOQO4c9o294LWmcfFf1XKSHDNVajNzKCTKurgU81tM0h+wEG7 lMGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+8mwHyTQD3viibZhlwqMBx4el6lQf1vUm4nyYwj8u4Q=; b=RCFM4ptgXJV8rcWgJZFDxaaiGWpYLSYgC/D1sfNzUXbEM5jlYdB1fyBKoaToF2x+sM LvT52CqBNhtYjUQqlRtkli1M1X/ItehgEiaY/m482bcaFZq+lHpsF5In2w1LwRmVPfxN wkkDKzS8ENHTghbFa3rbGecLusklkA8wID0Rxle96ONtVHok44flvlaxWCbvcSgFooQW 7x1FzMYa95hfTTmYDJ5aebzxJcNiUaUP2JKf3gnhd+IezMvJvJkvBOuEYHCeY4ht0k7R f2ocjlSYeBZp0T7wTL47IZg3Rx17SUY1KKBw3nasYHaZpPR2zWCegf63wnqkPnOhaj0L pLpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QX+XERJp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si6099577plo.377.2019.03.04.12.48.27; Mon, 04 Mar 2019 12:48:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QX+XERJp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726158AbfCDUrp (ORCPT + 99 others); Mon, 4 Mar 2019 15:47:45 -0500 Received: from mail-ua1-f67.google.com ([209.85.222.67]:44814 "EHLO mail-ua1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726054AbfCDUro (ORCPT ); Mon, 4 Mar 2019 15:47:44 -0500 Received: by mail-ua1-f67.google.com with SMTP id r21so5654657uan.11 for ; Mon, 04 Mar 2019 12:47:43 -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=BDtlSKOXQMX4DnOvc3gOWEamDcrkeVyJjgoT3sdawy8LnkrCrjHw7MDZLPB/wVMB0o zYW/YRwNHiOgQOWRjTbi1RMJkdgsRs+EVTrRBH/HdpStWxPyQugsoRtu+IQz9e5ceIxW KdpR3RRpsPKi30sChdTRxIcLKF9YQz+DP8FsRD/mOYJmgpT8q3DnBTIJA5pxKLLjqU8F oeTVch+PmBrfgUl53yCMZe2GfF9O6FEPEkbEbdzpFe3ixhFNS+9EhW7a2c4SSFoc/tHv iATux43vRrw3fICHRXbBStErVDuvOyMH54fXPIZcU6k6CBBQvTIHPgDYXZAmoAHBGvX6 Tn9A== X-Gm-Message-State: APjAAAXTM5Avz1PwUNG5pVrsXsRYEUST0PYQ5VoYW6NHLnZ7+MAfI2np SGSvlXHghxOfme45nBJovIMEBiKjUU4= X-Received: by 2002:a67:d403:: with SMTP id c3mr10473658vsj.67.1551732463362; Mon, 04 Mar 2019 12:47:43 -0800 (PST) Received: from mail-ua1-f53.google.com (mail-ua1-f53.google.com. [209.85.222.53]) by smtp.gmail.com with ESMTPSA id y125sm1554407vsy.0.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-f53.google.com with SMTP id u1so5661514uae.12 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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