* [PATCH net-next v2] bonding: remove bonding_priv.h
@ 2026-03-18 12:22 Breno Leitao
2026-03-19 17:47 ` Simon Horman
2026-03-21 1:40 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Breno Leitao @ 2026-03-18 12:22 UTC (permalink / raw)
To: Jay Vosburgh, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: netdev, linux-kernel, kernel-team, Breno Leitao
bonding_priv.h only defined DRV_NAME and DRV_DESCRIPTION, but caused
unnecessary recompilation: it included <generated/utsrelease.h> to
define bond_version, which is used solely in bond_procfs.c. With
CONFIG_LOCALVERSION_AUTO=y, utsrelease.h is regenerated on every git
commit, so any git operation triggered recompilation of bond_main.c
which also included bonding_priv.h.
Remove the header entirely, as suggested by Jakub, given the macros on
this file can be integrated into the C files directly.
Signed-off-by: Breno Leitao <leitao@debian.org>
---
Changes in v2:
- Remove drivers/net/bonding/bonding_priv.h completly (Jakub)
- Link to v1: https://patch.msgid.link/20260316-bond_uts-v1-1-428696ea79d5@debian.org
---
drivers/net/bonding/bond_main.c | 6 ++----
drivers/net/bonding/bond_procfs.c | 11 ++++++-----
drivers/net/bonding/bonding_priv.h | 22 ----------------------
3 files changed, 8 insertions(+), 31 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 90b71bd530401..d93d61ce6a08d 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -93,8 +93,6 @@
#include <net/netdev_lock.h>
#include <net/xdp.h>
-#include "bonding_priv.h"
-
/*---------------------------- Module parameters ----------------------------*/
/* monitor all links that often (in milliseconds). <=0 disables monitoring */
@@ -5874,7 +5872,7 @@ static int bond_ethtool_get_link_ksettings(struct net_device *bond_dev,
static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
struct ethtool_drvinfo *drvinfo)
{
- strscpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
+ strscpy(drvinfo->driver, KBUILD_MODNAME, sizeof(drvinfo->driver));
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), "%d",
BOND_ABI_VERSION);
}
@@ -6654,6 +6652,6 @@ static void __exit bonding_exit(void)
module_init(bonding_init);
module_exit(bonding_exit);
MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION(DRV_DESCRIPTION);
+MODULE_DESCRIPTION("Ethernet Channel Bonding Driver");
MODULE_AUTHOR("Thomas Davis, tadavis@lbl.gov and many others");
MODULE_IMPORT_NS("NETDEV_INTERNAL");
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index 7edf72ec816ab..e34f803051913 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -1,4 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
+#include <generated/utsrelease.h>
#include <linux/proc_fs.h>
#include <linux/ethtool.h>
#include <linux/export.h>
@@ -6,7 +7,7 @@
#include <net/netns/generic.h>
#include <net/bonding.h>
-#include "bonding_priv.h"
+#define bond_version "Ethernet Channel Bonding Driver: v" UTS_RELEASE "\n"
static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(RCU)
@@ -290,7 +291,7 @@ void bond_create_proc_entry(struct bonding *bond)
bn->proc_dir, &bond_info_seq_ops, bond);
if (bond->proc_entry == NULL)
netdev_warn(bond_dev, "Cannot create /proc/net/%s/%s\n",
- DRV_NAME, bond_dev->name);
+ KBUILD_MODNAME, bond_dev->name);
else
memcpy(bond->proc_file_name, bond_dev->name, IFNAMSIZ);
}
@@ -314,10 +315,10 @@ void bond_remove_proc_entry(struct bonding *bond)
void __net_init bond_create_proc_dir(struct bond_net *bn)
{
if (!bn->proc_dir) {
- bn->proc_dir = proc_mkdir(DRV_NAME, bn->net->proc_net);
+ bn->proc_dir = proc_mkdir(KBUILD_MODNAME, bn->net->proc_net);
if (!bn->proc_dir)
pr_warn("Warning: Cannot create /proc/net/%s\n",
- DRV_NAME);
+ KBUILD_MODNAME);
}
}
@@ -326,7 +327,7 @@ void __net_init bond_create_proc_dir(struct bond_net *bn)
void __net_exit bond_destroy_proc_dir(struct bond_net *bn)
{
if (bn->proc_dir) {
- remove_proc_entry(DRV_NAME, bn->net->proc_net);
+ remove_proc_entry(KBUILD_MODNAME, bn->net->proc_net);
bn->proc_dir = NULL;
}
}
diff --git a/drivers/net/bonding/bonding_priv.h b/drivers/net/bonding/bonding_priv.h
deleted file mode 100644
index fef6288c6944f..0000000000000
--- a/drivers/net/bonding/bonding_priv.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* SPDX-License-Identifier: GPL-1.0+ */
-/*
- * Bond several ethernet interfaces into a Cisco, running 'Etherchannel'.
- *
- * Portions are (c) Copyright 1995 Simon "Guru Aleph-Null" Janes
- * NCM: Network and Communications Management, Inc.
- *
- * BUT, I'm the one who modified it for ethernet, so:
- * (c) Copyright 1999, Thomas Davis, tadavis@lbl.gov
- *
- */
-
-#ifndef _BONDING_PRIV_H
-#define _BONDING_PRIV_H
-#include <generated/utsrelease.h>
-
-#define DRV_NAME "bonding"
-#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver"
-
-#define bond_version DRV_DESCRIPTION ": v" UTS_RELEASE "\n"
-
-#endif
---
base-commit: 5446b8691eb8278f10deca92048fad84ffd1e4d5
change-id: 20260316-bond_uts-077fed8dce56
Best regards,
--
Breno Leitao <leitao@debian.org>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next v2] bonding: remove bonding_priv.h
2026-03-18 12:22 [PATCH net-next v2] bonding: remove bonding_priv.h Breno Leitao
@ 2026-03-19 17:47 ` Simon Horman
2026-03-21 1:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2026-03-19 17:47 UTC (permalink / raw)
To: Breno Leitao
Cc: Jay Vosburgh, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, netdev, linux-kernel, kernel-team
On Wed, Mar 18, 2026 at 05:22:48AM -0700, Breno Leitao wrote:
> bonding_priv.h only defined DRV_NAME and DRV_DESCRIPTION, but caused
> unnecessary recompilation: it included <generated/utsrelease.h> to
> define bond_version, which is used solely in bond_procfs.c. With
> CONFIG_LOCALVERSION_AUTO=y, utsrelease.h is regenerated on every git
> commit, so any git operation triggered recompilation of bond_main.c
> which also included bonding_priv.h.
>
> Remove the header entirely, as suggested by Jakub, given the macros on
> this file can be integrated into the C files directly.
>
> Signed-off-by: Breno Leitao <leitao@debian.org>
> ---
> Changes in v2:
> - Remove drivers/net/bonding/bonding_priv.h completly (Jakub)
> - Link to v1: https://patch.msgid.link/20260316-bond_uts-v1-1-428696ea79d5@debian.org
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next v2] bonding: remove bonding_priv.h
2026-03-18 12:22 [PATCH net-next v2] bonding: remove bonding_priv.h Breno Leitao
2026-03-19 17:47 ` Simon Horman
@ 2026-03-21 1:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-21 1:40 UTC (permalink / raw)
To: Breno Leitao
Cc: jv, andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
linux-kernel, kernel-team
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Wed, 18 Mar 2026 05:22:48 -0700 you wrote:
> bonding_priv.h only defined DRV_NAME and DRV_DESCRIPTION, but caused
> unnecessary recompilation: it included <generated/utsrelease.h> to
> define bond_version, which is used solely in bond_procfs.c. With
> CONFIG_LOCALVERSION_AUTO=y, utsrelease.h is regenerated on every git
> commit, so any git operation triggered recompilation of bond_main.c
> which also included bonding_priv.h.
>
> [...]
Here is the summary with links:
- [net-next,v2] bonding: remove bonding_priv.h
https://git.kernel.org/netdev/net-next/c/79cfb2d1f25a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-21 1:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-18 12:22 [PATCH net-next v2] bonding: remove bonding_priv.h Breno Leitao
2026-03-19 17:47 ` Simon Horman
2026-03-21 1:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox