From nobody Sat Feb 7 13:41:19 2026 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 61CE0C7EE25 for ; Wed, 7 Jun 2023 12:09:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240558AbjFGMJR (ORCPT ); Wed, 7 Jun 2023 08:09:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240524AbjFGMJH (ORCPT ); Wed, 7 Jun 2023 08:09:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C678F1BDC for ; Wed, 7 Jun 2023 05:09:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3D75A6377D for ; Wed, 7 Jun 2023 12:09:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 009C4C43446; Wed, 7 Jun 2023 12:09:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686139742; bh=DY6GViYL/HPHEUA0RIEtbKs28uUpDP607FEoNig9h0s=; h=From:To:Cc:Subject:Date:From; b=uMp7oKY23T94+e2fDBoJtdemaAicrzwm6xKzR5WRma/mC/YIWAEcSuzrBcItSTK9g TSDxkRwjdW2qdmgeobGpfwR6POpppYYqCzck8kO+8nOASTtmg80Pw0DXiDCTuXhTlv jE4UpwcmnimfXB4htkzNveykv8UsjYIQ2ETQPzuCbZUrgk0JdvqmMgLUtkf6gIqtgJ KB75iK2ynaM4peK2jVaf1ujheybcK/2oGt7+pz7LzckkK0Xs8+qaSIMWthJkSe3g1c qZf36Z3oDzrAno5DcBQjOSZFFJXbUDSkobxs73w+512SGAWCJ2YDQ/Mh60ZEHLBx3o XwhjhK3yIESLQ== From: Arnd Bergmann To: Luis Chamberlain Cc: Arnd Bergmann , Peter Zijlstra , "Rafael J. Wysocki" , Andrew Morton , Huacai Chen , linux-kernel@vger.kernel.org Subject: [PATCH] sysctl: fix unused proc_cap_handler() function warning Date: Wed, 7 Jun 2023 14:08:54 +0200 Message-Id: <20230607120857.3621364-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann Since usermodehelper_table() is marked static now, we get a warning about it being unused when SYSCTL is disabled: kernel/umh.c:497:12: error: 'proc_cap_handler' defined but not used [-Werro= r=3Dunused-function] Just move it inside of the same #ifdef. Fixes: e6944e3b75df7 ("sysctl: move umh sysctl registration to its own file= ") Signed-off-by: Arnd Bergmann Acked-by: Randy Dunlap Tested-by: Matthieu Baerts Tested-by: Randy Dunlap # build-tested --- kernel/umh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/umh.c b/kernel/umh.c index d5dc3cc92d5c6..2f9249c2bf6ce 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); =20 +#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, in= t write, return 0; } =20 -#if defined(CONFIG_SYSCTL) static struct ctl_table usermodehelper_table[] =3D { { .procname =3D "bset", --=20 2.39.2