b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [PATCH] batman-adv: remove includes for extern declarations
Date: Thu, 28 Aug 2025 22:17:34 +0200	[thread overview]
Message-ID: <20250828-cleanup-header-v1-1-aac9d38d14bc@narfation.org> (raw)

It is not necessary to include the header for the struct definition for an
"extern " declaration. It can simply be dropped from the headers to reduce
the number of includes the preprocessor has to process. If needed, it can
be added to the actual C source file.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 compat.h                        | 3 +++
 net/batman-adv/hard-interface.c | 1 +
 net/batman-adv/hard-interface.h | 1 -
 net/batman-adv/mesh-interface.c | 1 +
 net/batman-adv/mesh-interface.h | 1 -
 net/batman-adv/netlink.h        | 1 -
 6 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/compat.h b/compat.h
index 638bfc54f3d0f9bd0a11e560a14121f567c5bfc9..11dd0411a6777fcf8b66f6cfae019921a5fa14a7 100644
--- a/compat.h
+++ b/compat.h
@@ -15,6 +15,9 @@
 
 #include "compat-autoconf.h"
 
+#if LINUX_VERSION_IS_LESS(5, 10, 0)
+#include "net/genetlink.h"
+#endif /* LINUX_VERSION_IS_LESS(5, 10, 0) */
 
 #endif /* __KERNEL__ */
 
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c
index bace57e4f9a516331baac04e96abe6ad1b2123dc..5113f879736b54f0231d0a030dd4bef5a320e9ae 100644
--- a/net/batman-adv/hard-interface.c
+++ b/net/batman-adv/hard-interface.c
@@ -22,6 +22,7 @@
 #include <linux/minmax.h>
 #include <linux/mutex.h>
 #include <linux/netdevice.h>
+#include <linux/notifier.h>
 #include <linux/printk.h>
 #include <linux/rculist.h>
 #include <linux/rtnetlink.h>
diff --git a/net/batman-adv/hard-interface.h b/net/batman-adv/hard-interface.h
index 262a7836474277ef2b39e3a2032201cb492b99c9..9db8a310961ead452a9775eb77d01ce51854b9cc 100644
--- a/net/batman-adv/hard-interface.h
+++ b/net/batman-adv/hard-interface.h
@@ -12,7 +12,6 @@
 #include <linux/compiler.h>
 #include <linux/kref.h>
 #include <linux/netdevice.h>
-#include <linux/notifier.h>
 #include <linux/rcupdate.h>
 #include <linux/stddef.h>
 #include <linux/types.h>
diff --git a/net/batman-adv/mesh-interface.c b/net/batman-adv/mesh-interface.c
index 5872818f4e31e52e9c8cf4118d8857e1169b5197..42a442066eb11dfb7c029b5aed81c58370937498 100644
--- a/net/batman-adv/mesh-interface.c
+++ b/net/batman-adv/mesh-interface.c
@@ -37,6 +37,7 @@
 #include <linux/string.h>
 #include <linux/types.h>
 #include <net/netlink.h>
+#include <net/rtnetlink.h>
 #include <uapi/linux/batadv_packet.h>
 #include <uapi/linux/batman_adv.h>
 
diff --git a/net/batman-adv/mesh-interface.h b/net/batman-adv/mesh-interface.h
index 7ba055b2bc269d57719fa5cdd50888155cbd3d44..53756c5a45e0471b82a21d3bbc4fd7d6b68924fb 100644
--- a/net/batman-adv/mesh-interface.h
+++ b/net/batman-adv/mesh-interface.h
@@ -13,7 +13,6 @@
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <linux/types.h>
-#include <net/rtnetlink.h>
 
 int batadv_skb_head_push(struct sk_buff *skb, unsigned int len);
 void batadv_interface_rx(struct net_device *mesh_iface,
diff --git a/net/batman-adv/netlink.h b/net/batman-adv/netlink.h
index fe4548b974bb095410bd6389751797d7d012ca85..4eae9e5ff13548e8ad925bc96d46d52274d74dd6 100644
--- a/net/batman-adv/netlink.h
+++ b/net/batman-adv/netlink.h
@@ -11,7 +11,6 @@
 
 #include <linux/netlink.h>
 #include <linux/types.h>
-#include <net/genetlink.h>
 
 void batadv_netlink_register(void);
 void batadv_netlink_unregister(void);

---
base-commit: 702c52a87eab8008e8c88e45a14462445d3f2d3a
change-id: 20250828-cleanup-header-7a4d56b75702

Best regards,
-- 
Sven Eckelmann <sven@narfation.org>


                 reply	other threads:[~2025-08-28 20:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250828-cleanup-header-v1-1-aac9d38d14bc@narfation.org \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).