Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp890966lqs; Tue, 5 Mar 2024 22:49:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWpw2hLDLDcPPaoMnwnpdl/H6HPD/+YgW+SXDK40/QcpXmGYVnKSglTHllnm66Hd/firFF8Yn83sj7pGg1PTjh2wOPaQuoV9Sowvlf8Kg== X-Google-Smtp-Source: AGHT+IEwxNUP4IB09+fdIbGHt8OE00M2D/cmiTKW62BJZ83IrKwYfJkzlCfRegNSMSeZDx5O+3uS X-Received: by 2002:a17:903:278d:b0:1dc:7856:220e with SMTP id jw13-20020a170903278d00b001dc7856220emr3604730plb.39.1709707778556; Tue, 05 Mar 2024 22:49:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709707778; cv=pass; d=google.com; s=arc-20160816; b=RJAJCSdvC7vNSctkS02eJkTs7r0CEL6PBiDbVmlz9tamt/Qttj+bLhZJgA0QGfOxyg tfrPoltMPLD/Af3eDREG4oKBMWbWDaHLJJpPlOQ5vjIoRftQMPWF9bSCmKzA/fZ9tOMV J6ZcYYfokNh0Bvb6j8AL7UU+Ag1tOzhalKRQ5D6rFjaBX5Ckvw7cxi6625yesx38rnlu hQ/mEnh3oyUfiBrEXIL6vCZsPA8G5zaC/Rm5uJDFygkJvbrBmeZDcMdd+yIAJtaI8CL2 p60N242ZGEhhj7hennLgeAlgD4y/smlN3Ljy68IdHLF5phB6yAaoNxLKnZY16enwX5bI 021Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=/c6Hm3gDCDtaaIyrsKxyD2qHB8kVPl0LEVVYbiRRpSE=; fh=1fP1SX9pV3nErvFDeZ26HCu1zf2WCr+mlR5vjD6mN7w=; b=RWhvi1wRx77g5cbcuYLdqGPiQeN+3XQCbqiFGUYMEXuOZYkd9+1y0cCg5BrKLVaSp9 3pQ0ogy7Tx/gfLheBwS6lv2ljQLFRx8YjIVVFAPrzIYUAcFwZKrAuNAx3cRghAPVbcDQ 7+xRAq1N8nNyqg+W84aL4oEUqM6AKpPxcOd1iSq2821wVtpsClAkdpDejdSkUx+SCcAS 7cDtIhypy6vfXGlq5ia8E7vNbX7Fu8ZDHaeiqWNMu0Iec4rMV4e3C+Tct3bAqvv5tNC6 LqkDkNE1oUrPlT2qOK9+fEGrbpvXri6PnYZEAr9zKZCq8xNgjLkV2btfuktz76HK+6ml 1Xng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=DjJtbwI7; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-93390-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93390-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id me7-20020a170902fc4700b001dbf5a95ef3si11520972plb.417.2024.03.05.22.49.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 22:49:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93390-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=DjJtbwI7; arc=pass (i=1 spf=pass spfdomain=weissschuh.net dkim=pass dkdomain=weissschuh.net); spf=pass (google.com: domain of linux-kernel+bounces-93390-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93390-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 39BB0286359 for ; Wed, 6 Mar 2024 06:49:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BCA1D5BAE0; Wed, 6 Mar 2024 06:49:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="DjJtbwI7" Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD715171BB for ; Wed, 6 Mar 2024 06:49:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709707771; cv=none; b=cMepSkBfn1PKBMlCVWVbNbcXzBDF8d+tet6zRghw9Z5NuFYw6DL3Di/awmBJEJ8Iekx5FRB6FBH66V76w7LdW99OXVV1sHa9jAkOpBYaX4wTKIShF0ZOcNUJy+2jcdQ1B1iAoByc7rs4J8GNNbhZLMDXlx+hiiAKUgpCvDKTFRo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709707771; c=relaxed/simple; bh=b/nO7us7hYB0VszOCL9lFmQyRWHDXkJW3ruCl9UdwOA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=ARJVaf1NCjM57bpI4/xYKGEZOxAuL8OJYfjhmAnpgNHNCjH4CvToKHqgO1z1l8ZrXRoSnnIBGakaGzGQ5cRQDNfy+kjoPIAlV41Phq/6ViUZlyNjew1yNNEUS/AhQaRXIJdAYFfUKRZ1MNHZ0FEg7Uzqt5IjnAQzaIyg2RGc4bE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=DjJtbwI7; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1709707759; bh=b/nO7us7hYB0VszOCL9lFmQyRWHDXkJW3ruCl9UdwOA=; h=From:Date:Subject:To:Cc:From; b=DjJtbwI7qX1cmaKDD+8DUdHUKG/cSgDfs89ru/WHXMucQU9ls8+3ZjQW1zMY3lqfd SNW3aKEtBONLztlr6FrUcTs1uNfAXOrnyGOwEebLk0/2xv3g6kLWhtzNMaJeTIRwUc vBzWutJ1Ah6QjYTHCTstQVWG5k6Nd4voItAJ9iag= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Wed, 06 Mar 2024 07:49:16 +0100 Subject: [PATCH] watchdog/core: remove sysctl handlers from public header Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240306-const-sysctl-prep-watchdog-v1-1-bd45da3a41cf@weissschuh.net> X-B4-Tracking: v=1; b=H4sIAOsR6GUC/x3MTQqEMAxA4atI1hOotcjoVWQWkkYNSCtN8Qfx7 pZZfjx4NygnYYW+uiHxLioxFNSfCmgZw8wovhissc40pkWKQTPqpZRX3BJveIyZFh9nnOhL3rf OOuqgDEqd5PzPh9/zvB4R6qtsAAAA To: Andrew Morton Cc: linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1709707756; l=3733; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=b/nO7us7hYB0VszOCL9lFmQyRWHDXkJW3ruCl9UdwOA=; b=qrN/3paDMKoRS//KvwBvwJRR6orfkwT4cD/VQVa3JvfSu0LVX7MLiwVoLBQ146pY0EJ2fmZLZ YPGGyH9q3O9BzqhP+kPfj6RXAmftA2eRCBKwqIdeH7jIysbNAjFNeww X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= The functions are only used in the file where they are defined. Remove them from the header and make them static. Also guard proc_soft_watchdog with a #define-guard as it is not used otherwise. Signed-off-by: Thomas Weißschuh --- include/linux/nmi.h | 7 ------- kernel/watchdog.c | 22 ++++++++++++---------- 2 files changed, 12 insertions(+), 17 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 81a8862295d6..d7b2125503af 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -796,8 +796,8 @@ 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, - void *buffer, size_t *lenp, loff_t *ppos) +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 | WATCHDOG_SOFTOCKUP_ENABLED, @@ -807,8 +807,8 @@ int proc_watchdog(struct ctl_table *table, int write, /* * /proc/sys/kernel/nmi_watchdog */ -int proc_nmi_watchdog(struct ctl_table *table, int write, - void *buffer, size_t *lenp, loff_t *ppos) +static int proc_nmi_watchdog(struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { if (!watchdog_hardlockup_available && write) return -ENOTSUPP; @@ -816,21 +816,23 @@ int proc_nmi_watchdog(struct ctl_table *table, int write, table, write, buffer, lenp, ppos); } +#ifdef CONFIG_SOFTLOCKUP_DETECTOR /* * /proc/sys/kernel/soft_watchdog */ -int proc_soft_watchdog(struct ctl_table *table, int write, - void *buffer, size_t *lenp, loff_t *ppos) +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, table, write, buffer, lenp, ppos); } +#endif /* * /proc/sys/kernel/watchdog_thresh */ -int proc_watchdog_thresh(struct ctl_table *table, int write, - void *buffer, size_t *lenp, loff_t *ppos) +static int proc_watchdog_thresh(struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { int err, old; @@ -852,8 +854,8 @@ 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, - void *buffer, size_t *lenp, loff_t *ppos) +static int proc_watchdog_cpumask(struct ctl_table *table, int write, + void *buffer, size_t *lenp, loff_t *ppos) { int err; --- base-commit: 5847c9777c303a792202c609bd761dceb60f4eed change-id: 20240306-const-sysctl-prep-watchdog-fc8cdd6424c9 Best regards, -- Thomas Weißschuh