From d2efeb52c344c3e987d143dc5232f53f9b96c86a Mon Sep 17 00:00:00 2001 From: Jann Horn Date: Tue, 20 Feb 2024 20:42:44 +0100 Subject: net: ethtool: avoid rebuilds on UTS_RELEASE change Currently, when you switch between branches or something like that and rebuild, net/ethtool/ioctl.c has to be built again because it depends on UTS_RELEASE. By instead referencing a string variable stored in another object file, this can be avoided. Signed-off-by: Jann Horn Reviewed-by: John Garry Link: https://lore.kernel.org/r/20240220194244.2056384-1-jannh@google.com Signed-off-by: Jakub Kicinski --- net/ethtool/ioctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index 1763e8b697e1..b419969c0dcb 100644 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c @@ -26,12 +26,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include "common.h" /* State held across locks and calls for commands which have devlink fallback */ @@ -713,7 +713,8 @@ ethtool_get_drvinfo(struct net_device *dev, struct ethtool_devlink_compat *rsp) struct device *parent = dev->dev.parent; rsp->info.cmd = ETHTOOL_GDRVINFO; - strscpy(rsp->info.version, UTS_RELEASE, sizeof(rsp->info.version)); + strscpy(rsp->info.version, init_uts_ns.name.release, + sizeof(rsp->info.version)); if (ops->get_drvinfo) { ops->get_drvinfo(dev, &rsp->info); if (!rsp->info.bus_info[0] && parent) -- cgit v1.2.3-59-g8ed1b