From patchwork Wed Jun 7 12:08:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 104479 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:3046:b0:115:7a1d:dabb with SMTP id p6csp321384rwl; Wed, 7 Jun 2023 05:36:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4/w5HIEAI6fH4gX87LrNOT8RleGuKvuYe/d2sO2JLMn6hdLQZvLpX4BnZg1lLF3Yl5AMC8 X-Received: by 2002:a05:6808:3ba:b0:39a:618b:17e2 with SMTP id n26-20020a05680803ba00b0039a618b17e2mr5786338oie.21.1686141361809; Wed, 07 Jun 2023 05:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686141361; cv=none; d=google.com; s=arc-20160816; b=UPt3xWF8Od3uUwao0k8R5YkDYLDfXzQTIsR+FtyFajSy6gq4rFIVWCmYmRIYxOihyF e2scgMkj3bCLwgMX0c0oLm3cQDEB7XalpSQN/dMzQnEC7BOz5CfyrSCfbWfa/ST5mEkJ 2Hhx0CEewA78DM4y/c85P5qpvkzm35usboWvwwL+TSVrGlXVmt54qx6MNsbXMPgY19/1 SkHYjfOA5PpA1LqDd4UOslD+kkujH37yhdIuOntg1roPvlH/GhJIkeLcBJzfFn1jdJrk mQpf7CdY0//tOOU3/B/X8ShWr6gnq4ceTsJ0WjbjgHGyw2a/9Kfpw4HyLDXyblyxnzjk b8bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=xukEGkJwpvPcaCiaY1RpDo1/w4PmnFkDjPmaQQIW5ps=; b=B2z/O/vQPq3NsrKMUjZz3O2tlPpG8fA5tuNRtxvtJMo9W9pGrqEwE81Sb5kpz1d9Wl 4Y5stiAyfiqyhT7AEeYrIZ6Lvw0hHa4l7qePARo6M9Ob9d46T5zHWrxkrN41X2yRYP32 ujFnrzghkXqrv3io5AvVP6I4xuEMJQ2t43xf3FMyNjfeXrpzEZ3ivE9co4Ww6wOs+e83 Wb1tNfd8sPBC4dsCJpz4n0RXWLerIrcrdE91N+Mzv9M8G2m/PcVYmUmkUFMUlnSm3W0g ccQO6ZWXfxT1VnwX7hoEF697p05wV5Jj5wkDnUhkyNM6ZJ1mKozCeA2Ulpn8vzS6WxTz Ie6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uMp7oKY2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d25-20020a637359000000b0051b29733bc9si8791570pgn.715.2023.06.07.05.35.48; Wed, 07 Jun 2023 05:36:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uMp7oKY2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240548AbjFGMJR (ORCPT + 99 others); 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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768047364851415399?= X-GMAIL-MSGID: =?utf-8?q?1768047364851415399?= 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 [-Werror=unused-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: Randy Dunlap # build-tested Tested-by: Matthieu Baerts --- 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); +#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",