From patchwork Mon Dec 4 07:52:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 173097 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp2608638vqy; Sun, 3 Dec 2023 23:52:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTK4t3OHZXT4NQOfctQGjgutS6bKmYcMjOm0IA2DsXFTr0Fk4MuXS5N0+AxDwniUHHtCXB X-Received: by 2002:a05:6358:50c6:b0:170:17ea:f4db with SMTP id m6-20020a05635850c600b0017017eaf4dbmr4088530rwm.40.1701676361081; Sun, 03 Dec 2023 23:52:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701676361; cv=none; d=google.com; s=arc-20160816; b=uW+g6YeAShrfrShSgkX0J5XPqSjXHiCzMppTJnyw0inamlIBfv5wPVSnrbw/PDbqGr P9+N6X8am7WCHu3pk+Rftarw0TB8w/5i5cSjQLCACbeREkQMN9FiZqy3P7xKLTJwXlzA 4ZIDM1Uc7B5SMc5fUIiTvgYYhfUvkogiCkPamCAO8egzBFV6kqoYNmve1oQgCPnkQlYf QMB4lhOH37uflBIHmq+TZToStoEoreXGLA4dxl9icds5ycg0FUKxRJnsCFKPlkjpZKKB X5Z47jhkFgZG3pQRXMxYVhbwqsqPBoW3oXnIpG7iF2CD+k93lgUjQg8C1L7HCXR6Uv+n VRpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=u0PVsmDOCQTa8z4XCNFVrPYG30bnxzHW7SpjDrTihgw=; fh=1v5zqbO9sIGUc9bsdyhYE0zxdK1knZz2xnJYWUWMFKo=; b=x79NfwfaDnuUQDNx4aZeSvnNy7NABOIYoIMIy4dasIOiAZ8/jGMAucJzyNQY4SgQvp M7lY1x/XBAfNLJfdZyQ4FYzSiW3Ha6QPVF9uHN7gbwv6Vifevyy/mCClbouFvJJTrJBG ggV7FfuVRrydW7kRPDd3bREDmjtKbl6lm5dFetGm4Cxx1WDIyBBpRbk0b7GjfXNeqRqa WdlW1PvzGMpI752tvOwWM483888AO+OeXtwRCA6TJ0BpmXznUiQqSMItvk56bt8AS6+K JiS+QGRIW1AIlmcJqZz8B/BsWFlG8p1jAOBsxq6HTFHMKD/TGRWqlw+Lb3NI4f60nrr+ mDLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=YZPlhHxE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id be3-20020a656e43000000b005b9a1494637si7814668pgb.317.2023.12.03.23.52.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 23:52:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=YZPlhHxE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 939998068FD5; Sun, 3 Dec 2023 23:52:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234710AbjLDHw2 (ORCPT + 99 others); Mon, 4 Dec 2023 02:52:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234688AbjLDHw1 (ORCPT ); Mon, 4 Dec 2023 02:52:27 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28D46FF; Sun, 3 Dec 2023 23:52:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1701676351; bh=jiUoP9EILBqjXJdhjCd6wCOIBwbA+1GPrmYgkgR4m/M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=YZPlhHxEX6oI7g8G2LKXf/0qWZsZyCVOccYQzag5Ib0JfOmdslPSqC02Lm5IVfa3V NfYWDXaB1wpUtcwFKNl/iui8AG1y0biZQzCEo/kstXkAPmgY865s0R0m17Uq6kJPoA 5Hhw+R4gLkxRIE/ks80cNBL7k4qMXjau4nE8joP4= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 04 Dec 2023 08:52:14 +0100 Subject: [PATCH v2 01/18] watchdog/core: remove sysctl handlers from public header MIME-Version: 1.0 Message-Id: <20231204-const-sysctl-v2-1-7a5060b11447@weissschuh.net> References: <20231204-const-sysctl-v2-0-7a5060b11447@weissschuh.net> In-Reply-To: <20231204-const-sysctl-v2-0-7a5060b11447@weissschuh.net> To: Kees Cook , "Gustavo A. R. Silva" , Luis Chamberlain , Iurii Zaikin , Greg Kroah-Hartman , Joel Granados Cc: linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1701676350; l=3077; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=jiUoP9EILBqjXJdhjCd6wCOIBwbA+1GPrmYgkgR4m/M=; b=N668jhYnDq/m98yRu3KJUDGYvbbTXjPausZ1wtJee7HDZsf73TfhAf+uRsaSar7Bl1MjM4b1f y4xDB12U1prASWAMR2lxo2BG40azT17eSnNK1xvNxwTk7wvRe1prpvc X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 03 Dec 2023 23:52:36 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784336991903153568 X-GMAIL-MSGID: 1784336991903153568 The functions are only used in the file where they are defined. Remove them from the header and make them static. Signed-off-by: Thomas Weißschuh --- include/linux/nmi.h | 7 ------- kernel/watchdog.c | 10 +++++----- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/include/linux/nmi.h b/include/linux/nmi.h index e92e378df000..f53438eae815 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h @@ -216,13 +216,6 @@ void watchdog_update_hrtimer_threshold(u64 period); static inline void watchdog_update_hrtimer_threshold(u64 period) { } #endif -struct ctl_table; -int proc_watchdog(struct ctl_table *, int, void *, size_t *, loff_t *); -int proc_nmi_watchdog(struct ctl_table *, int , void *, size_t *, loff_t *); -int proc_soft_watchdog(struct ctl_table *, int , void *, size_t *, loff_t *); -int proc_watchdog_thresh(struct ctl_table *, int , void *, size_t *, loff_t *); -int proc_watchdog_cpumask(struct ctl_table *, int, void *, size_t *, loff_t *); - #ifdef CONFIG_HAVE_ACPI_APEI_NMI #include #endif diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 5cd6d4e26915..0fe72e89627d 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -772,7 +772,7 @@ static int proc_watchdog_common(int which, struct ctl_table *table, int write, /* * /proc/sys/kernel/watchdog */ -int proc_watchdog(struct ctl_table *table, int write, +static int proc_watchdog(struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return proc_watchdog_common(WATCHDOG_HARDLOCKUP_ENABLED | @@ -783,7 +783,7 @@ int proc_watchdog(struct ctl_table *table, int write, /* * /proc/sys/kernel/nmi_watchdog */ -int proc_nmi_watchdog(struct ctl_table *table, int write, +static int proc_nmi_watchdog(struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { if (!watchdog_hardlockup_available && write) @@ -795,7 +795,7 @@ int proc_nmi_watchdog(struct ctl_table *table, int write, /* * /proc/sys/kernel/soft_watchdog */ -int proc_soft_watchdog(struct ctl_table *table, int write, +static int proc_soft_watchdog(struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { return proc_watchdog_common(WATCHDOG_SOFTOCKUP_ENABLED, @@ -805,7 +805,7 @@ int proc_soft_watchdog(struct ctl_table *table, int write, /* * /proc/sys/kernel/watchdog_thresh */ -int proc_watchdog_thresh(struct ctl_table *table, int write, +static int proc_watchdog_thresh(struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int err, old; @@ -828,7 +828,7 @@ int proc_watchdog_thresh(struct ctl_table *table, int write, * user to specify a mask that will include cpus that have not yet * been brought online, if desired. */ -int proc_watchdog_cpumask(struct ctl_table *table, int write, +static int proc_watchdog_cpumask(struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { int err;