[PATCH net-next] bonding: move utsrelease.h include out of bonding_priv.h
From: Breno Leitao
Date: Mon Mar 16 2026 - 08:22:07 EST
bonding_priv.h includes <generated/utsrelease.h> only to define
bond_version, which is used solely in bond_procfs.c. This causes every
file that includes bonding_priv.h to be recompiled whenever the kernel
version string changes (bond_main.c specifically). With
CONFIG_LOCALVERSION_AUTO=y, utsrelease.h is regenerated on every git
commit, so any git operation (revert, cherry-pick, bissect etc.)
triggers unnecessary recompilation of bond_main.
Move the include and the bond_version definition to bond_procfs.c,
which is the only consumer. This is consistent with how other drivers
use UTS_RELEASE (ixgbe, ice, i40e, ionic, nvme/target, DRM drivers,
firmware_loader, etc.), all of which include utsrelease.h directly in
the .c file that needs it rather than in a shared header.
Signed-off-by: Breno Leitao <leitao@xxxxxxxxxx>
---
drivers/net/bonding/bond_procfs.c | 3 +++
drivers/net/bonding/bonding_priv.h | 4 ----
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index 7edf72ec816ab..6abe8916202dc 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -6,8 +6,11 @@
#include <net/netns/generic.h>
#include <net/bonding.h>
+#include <generated/utsrelease.h>
#include "bonding_priv.h"
+#define bond_version DRV_DESCRIPTION ": v" UTS_RELEASE "\n"
+
static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(RCU)
{
diff --git a/drivers/net/bonding/bonding_priv.h b/drivers/net/bonding/bonding_priv.h
index fef6288c6944f..f9b327b6a494a 100644
--- a/drivers/net/bonding/bonding_priv.h
+++ b/drivers/net/bonding/bonding_priv.h
@@ -12,11 +12,7 @@
#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@xxxxxxxxxx>