linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] sysctl: Remove unused ctl_table forward declarations
@ 2025-12-17 12:16 Joel Granados
  2025-12-19  9:28 ` Paolo Abeni
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Granados @ 2025-12-17 12:16 UTC (permalink / raw)
  To: Alexander Viro, Christian Brauner, Jan Kara, Muchun Song,
	Oscar Salvador, David Hildenbrand, Petr Mladek, Steven Rostedt,
	John Ogness, Sergey Senozhatsky, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman
  Cc: linux-fsdevel, linux-kernel, linux-mm, linux-hams, netdev, Joel Granados

Remove superfluous forward declarations of ctl_table from header files
where they are no longer needed. These declarations were left behind
after sysctl code refactoring and cleanup.

Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: Muchun Song <muchun.song@linux.dev>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
---
Apologies for such a big To: list. My idea is for this to go into
mainline through sysctl; get back to me if you prefer otherwise. On the
off chance that this has a V3, let me know if you want to be removed
from the To and I'll make that happen
---
Changes in v2:
- Replaced a ctl_table forward declaration in kernel/printk/internal.h
  with an actual #include <linux/sysctl.h>
- Link to v1: https://lore.kernel.org/r/20251215-jag-sysctl_fw_decl-v1-1-2a9af78448f8@kernel.org
---
 include/linux/fs.h       | 1 -
 include/linux/hugetlb.h  | 2 --
 include/linux/printk.h   | 1 -
 include/net/ax25.h       | 2 --
 kernel/printk/internal.h | 2 +-
 kernel/printk/sysctl.c   | 1 -
 6 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 04ceeca12a0d5caadb68643bf68b7a78e17c08d4..77f6302fdced1ef7e61ec1b35bed77c77b294124 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -3487,7 +3487,6 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf,
 ssize_t simple_attr_write_signed(struct file *file, const char __user *buf,
 				 size_t len, loff_t *ppos);
 
-struct ctl_table;
 int __init list_bdev_fs_names(char *buf, size_t size);
 
 #define __FMODE_EXEC		((__force int) FMODE_EXEC)
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 019a1c5281e4e6e04a9207dff7f7aa58c9669a80..18d1c4ecc4f948b179679b8fcc7870f3d466a4d9 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -16,8 +16,6 @@
 #include <linux/userfaultfd_k.h>
 #include <linux/nodemask.h>
 
-struct ctl_table;
-struct user_struct;
 struct mmu_gather;
 struct node;
 
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 45c663124c9bd3b294031d839f1253f410313faa..63d516c873b4c412eead6ee4eb9f90a5c28f630c 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -78,7 +78,6 @@ extern void console_verbose(void);
 /* strlen("ratelimit") + 1 */
 #define DEVKMSG_STR_MAX_SIZE 10
 extern char devkmsg_log_str[DEVKMSG_STR_MAX_SIZE];
-struct ctl_table;
 
 extern int suppress_printk;
 
diff --git a/include/net/ax25.h b/include/net/ax25.h
index a7bba42dde153a2aeaf010a7ef8b48d39d15a835..beec9712e9c71d4be90acb6fc7113022527bc1ab 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -215,8 +215,6 @@ typedef struct {
 	unsigned short		slave_timeout;		/* when? */
 } ax25_dama_info;
 
-struct ctl_table;
-
 typedef struct ax25_dev {
 	struct list_head	list;
 
diff --git a/kernel/printk/internal.h b/kernel/printk/internal.h
index 5f5f626f427942ed8ea310f08c285775d8e095a6..29a3bd1799d426bc7b5ebdc28ff8b75214c57a57 100644
--- a/kernel/printk/internal.h
+++ b/kernel/printk/internal.h
@@ -4,9 +4,9 @@
  */
 #include <linux/console.h>
 #include <linux/types.h>
+#include <linux/sysctl.h>
 
 #if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL)
-struct ctl_table;
 void __init printk_sysctl_init(void);
 int devkmsg_sysctl_set_loglvl(const struct ctl_table *table, int write,
 			      void *buffer, size_t *lenp, loff_t *ppos);
diff --git a/kernel/printk/sysctl.c b/kernel/printk/sysctl.c
index da77f3f5c1fe917d9ce2d777355403f123587757..f15732e93c2e9c0865c42e4af9cb6458d4402c0a 100644
--- a/kernel/printk/sysctl.c
+++ b/kernel/printk/sysctl.c
@@ -3,7 +3,6 @@
  * sysctl.c: General linux system control interface
  */
 
-#include <linux/sysctl.h>
 #include <linux/printk.h>
 #include <linux/capability.h>
 #include <linux/ratelimit.h>

---
base-commit: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
change-id: 20251215-jag-sysctl_fw_decl-58c718715c8c

Best regards,
-- 
Joel Granados <joel.granados@kernel.org>




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] sysctl: Remove unused ctl_table forward declarations
  2025-12-17 12:16 [PATCH v2] sysctl: Remove unused ctl_table forward declarations Joel Granados
@ 2025-12-19  9:28 ` Paolo Abeni
  2025-12-19 11:03   ` Joel Granados
  0 siblings, 1 reply; 3+ messages in thread
From: Paolo Abeni @ 2025-12-19  9:28 UTC (permalink / raw)
  To: Joel Granados, Alexander Viro, Christian Brauner, Jan Kara,
	Muchun Song, Oscar Salvador, David Hildenbrand, Petr Mladek,
	Steven Rostedt, John Ogness, Sergey Senozhatsky, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Simon Horman
  Cc: linux-fsdevel, linux-kernel, linux-mm, linux-hams, netdev

On 12/17/25 1:16 PM, Joel Granados wrote:
> Remove superfluous forward declarations of ctl_table from header files
> where they are no longer needed. These declarations were left behind
> after sysctl code refactoring and cleanup.
> 
> Reviewed-by: Jan Kara <jack@suse.cz>
> Acked-by: Muchun Song <muchun.song@linux.dev>
> Reviewed-by: Petr Mladek <pmladek@suse.com>
> Signed-off-by: Joel Granados <joel.granados@kernel.org>
> ---
> Apologies for such a big To: list. My idea is for this to go into
> mainline through sysctl; get back to me if you prefer otherwise. On the
> off chance that this has a V3, let me know if you want to be removed
> from the To and I'll make that happen

For the net bits:

Acked-by: Paolo Abeni <pabeni@redhat.com>

I'm ok with merging this via the sysctl tree, given that we don't see
much action happening in the ax25 header (and very low chances of
conflicts). But I would be also ok if you would split this into multiple
patches, one for each affected subsystem.

/P




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] sysctl: Remove unused ctl_table forward declarations
  2025-12-19  9:28 ` Paolo Abeni
@ 2025-12-19 11:03   ` Joel Granados
  0 siblings, 0 replies; 3+ messages in thread
From: Joel Granados @ 2025-12-19 11:03 UTC (permalink / raw)
  To: Paolo Abeni
  Cc: Alexander Viro, Christian Brauner, Jan Kara, Muchun Song,
	Oscar Salvador, David Hildenbrand, Petr Mladek, Steven Rostedt,
	John Ogness, Sergey Senozhatsky, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Simon Horman, linux-fsdevel, linux-kernel,
	linux-mm, linux-hams, netdev

[-- Attachment #1: Type: text/plain, Size: 1212 bytes --]

On Fri, Dec 19, 2025 at 10:28:31AM +0100, Paolo Abeni wrote:
> On 12/17/25 1:16 PM, Joel Granados wrote:
> > Remove superfluous forward declarations of ctl_table from header files
> > where they are no longer needed. These declarations were left behind
> > after sysctl code refactoring and cleanup.
> > 
> > Reviewed-by: Jan Kara <jack@suse.cz>
> > Acked-by: Muchun Song <muchun.song@linux.dev>
> > Reviewed-by: Petr Mladek <pmladek@suse.com>
> > Signed-off-by: Joel Granados <joel.granados@kernel.org>
> > ---
> > Apologies for such a big To: list. My idea is for this to go into
> > mainline through sysctl; get back to me if you prefer otherwise. On the
> > off chance that this has a V3, let me know if you want to be removed
> > from the To and I'll make that happen
> 
> For the net bits:
> 
> Acked-by: Paolo Abeni <pabeni@redhat.com>
> 
> I'm ok with merging this via the sysctl tree, given that we don't see
> much action happening in the ax25 header (and very low chances of
> conflicts). But I would be also ok if you would split this into multiple
> patches, one for each affected subsystem.
I'll separate it, if I send a V3

Thx for the feedback.

-- 

Joel Granados

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-19 11:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-17 12:16 [PATCH v2] sysctl: Remove unused ctl_table forward declarations Joel Granados
2025-12-19  9:28 ` Paolo Abeni
2025-12-19 11:03   ` Joel Granados

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox