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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C97DEB64DC for ; Thu, 29 Jun 2023 16:21:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232445AbjF2QVF (ORCPT ); Thu, 29 Jun 2023 12:21:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232421AbjF2QVC (ORCPT ); Thu, 29 Jun 2023 12:21:02 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32E172D7F for ; Thu, 29 Jun 2023 09:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Cc:Content-ID:Content-Description; bh=9Swsu6T6iCmcyucr6iqf2XEYc9qOiNmC8LbPDgOq4Jo=; b=u2SGpDLcP9XhWOGumUk4v6kGxl gEkGk7BDvYF+KKLBiKDX4+dUzQfz5n9qEGMQe/hGStlDMCDvOjQoNmWyJ43nGq0mea6diaIiwYTcP AuD87HZ3OEGMMmyw3OAQQDrAlyovAOBvujtAA2GQ3i5HuCxQhwly+Rpg+Zz3x7+uO9RLgpgoo6yhE diXBr3mHCkAiAmaGiWKjSJS2gLPIKd0497UuyW3VCG51kWYVBHrXlYomuqAddun92xYgUSoeT9XZL G09jJ5K2T0tOfB0acaQikMQt+NcHnwBh7ZpK+SzHwf3X+mb3cgpMeX/EL8bsRUXLERxZjRX7mfQSv AV4bHuhg==; Received: from [2601:1c2:980:9ec0::2764] by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qEuOA-001W9Q-33; Thu, 29 Jun 2023 16:20:58 +0000 Message-ID: <599ba86b-1f33-4ba2-5781-cd98ecfa985c@infradead.org> Date: Thu, 29 Jun 2023 09:20:56 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH] umh: fix build warning with CONFIG_SYSCTL disabled Content-Language: en-US To: Matteo Rizzo , jarkko@kernel.org, mcgrof@kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann References: <20230629161044.1995505-1-matteorizzo@google.com> From: Randy Dunlap In-Reply-To: <20230629161044.1995505-1-matteorizzo@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 6/29/23 09:10, Matteo Rizzo wrote: > When CONFIG_SYSCTL is not defined proc_cap_handler is not used. This > causes a build warning with -Wunused-function. > > kernel/umh.c:497:12: error: unused function 'proc_cap_handler' > [-Werror,-Wunused-function] > static int proc_cap_handler(struct ctl_table *table, int write, > ^ > 1 error generated. > > Fixes: 861dc0b46432 ("sysctl: move umh sysctl registration to its own file") > Signed-off-by: Matteo Rizzo Arnd sent this same patch on 2023-June-07. I have been wondering why it has not been merged... > --- > kernel/umh.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/umh.c b/kernel/umh.c > index 41088c5c39fd..1b13c5d34624 100644 > --- a/kernel/umh.c > +++ b/kernel/umh.c > @@ -494,6 +494,7 @@ int call_usermodehelper(const char *path, char **argv, char **envp, int wait) > } > EXPORT_SYMBOL(call_usermodehelper); > > +#if defined(CONFIG_SYSCTL) > static int proc_cap_handler(struct ctl_table *table, int write, > void *buffer, size_t *lenp, loff_t *ppos) > { > @@ -544,7 +545,6 @@ static int proc_cap_handler(struct ctl_table *table, int write, > return 0; > } > > -#if defined(CONFIG_SYSCTL) > static struct ctl_table usermodehelper_table[] = { > { > .procname = "bset", thanks. -- ~Randy