* [PATCH] batman-adv: remove includes for extern declarations
@ 2025-08-28 20:17 Sven Eckelmann
0 siblings, 0 replies; only message in thread
From: Sven Eckelmann @ 2025-08-28 20:17 UTC (permalink / raw)
To: b.a.t.m.a.n
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>
---
| 3 +++
| 1 +
| 1 -
| 1 +
| 1 -
| 1 -
6 files changed, 5 insertions(+), 3 deletions(-)
--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__ */
--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>
--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>
--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>
--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,
--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>
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-28 20:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28 20:17 [PATCH] batman-adv: remove includes for extern declarations Sven Eckelmann
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).