diff mbox series

[RFC,3/4] net: ethtool: Use uts_release

Message ID 20240131104851.2311358-4-john.g.garry@oracle.com (mailing list archive)
State New
Headers show
Series Introduce uts_release | expand

Commit Message

John Garry Jan. 31, 2024, 10:48 a.m. UTC
Instead of using UTS_RELEASE, use uts_release, which means that we don't
need to rebuild the code just for the git head commit changing.

Signed-off-by: John Garry <john.g.garry@oracle.com>
---
 net/ethtool/ioctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jakub Kicinski Jan. 31, 2024, 7:24 p.m. UTC | #1
On Wed, 31 Jan 2024 10:48:50 +0000 John Garry wrote:
> Instead of using UTS_RELEASE, use uts_release, which means that we don't
> need to rebuild the code just for the git head commit changing.
> 
> Signed-off-by: John Garry <john.g.garry@oracle.com>

Yes, please!

Acked-by: Jakub Kicinski <kuba@kernel.org>
John Garry Feb. 1, 2024, 12:57 p.m. UTC | #2
On 31/01/2024 19:24, Jakub Kicinski wrote:
> On Wed, 31 Jan 2024 10:48:50 +0000 John Garry wrote:
>> Instead of using UTS_RELEASE, use uts_release, which means that we don't
>> need to rebuild the code just for the git head commit changing.
>>
>> Signed-off-by: John Garry<john.g.garry@oracle.com>
> Yes, please!
> 
> Acked-by: Jakub Kicinski<kuba@kernel.org>

Cheers

BTW, I assume that changes like this are also ok:

--------8<---------

    net: team: Don't bother filling in ethtool driver version

    The version is same as the default, as don't bother.

    Signed-off-by: John Garry <john.g.garry@oracle.com>

diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index f575f225d417..0a44bbdcfb7b 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -25,7 +25,6 @@
#include <net/genetlink.h>
#include <net/netlink.h>
#include <net/sch_generic.h>
-#include <generated/utsrelease.h>
#include <linux/if_team.h>

#define DRV_NAME "team"
@@ -2074,7 +2073,6 @@ static void team_ethtool_get_drvinfo(struct
net_device *dev,
                                     struct ethtool_drvinfo *drvinfo)
{
        strscpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
-       strscpy(drvinfo->version, UTS_RELEASE, sizeof(drvinfo->version));
}

-------->8---------

right?

John
Jiri Pirko Feb. 1, 2024, 1:20 p.m. UTC | #3
Thu, Feb 01, 2024 at 01:57:16PM CET, john.g.garry@oracle.com wrote:
>On 31/01/2024 19:24, Jakub Kicinski wrote:
>> On Wed, 31 Jan 2024 10:48:50 +0000 John Garry wrote:
>> > Instead of using UTS_RELEASE, use uts_release, which means that we don't
>> > need to rebuild the code just for the git head commit changing.
>> > 
>> > Signed-off-by: John Garry<john.g.garry@oracle.com>
>> Yes, please!
>> 
>> Acked-by: Jakub Kicinski<kuba@kernel.org>
>
>Cheers
>
>BTW, I assume that changes like this are also ok:
>
>--------8<---------
>
>   net: team: Don't bother filling in ethtool driver version
>
>   The version is same as the default, as don't bother.
>
>   Signed-off-by: John Garry <john.g.garry@oracle.com>
>
>diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
>index f575f225d417..0a44bbdcfb7b 100644
>--- a/drivers/net/team/team.c
>+++ b/drivers/net/team/team.c
>@@ -25,7 +25,6 @@
>#include <net/genetlink.h>
>#include <net/netlink.h>
>#include <net/sch_generic.h>
>-#include <generated/utsrelease.h>
>#include <linux/if_team.h>
>
>#define DRV_NAME "team"
>@@ -2074,7 +2073,6 @@ static void team_ethtool_get_drvinfo(struct
>net_device *dev,
>                                    struct ethtool_drvinfo *drvinfo)
>{
>       strscpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
>-       strscpy(drvinfo->version, UTS_RELEASE, sizeof(drvinfo->version));

Yeah. I don't see why should anyone care about this "version"...
Let's remove it.

>}
>
>-------->8---------
>
>right?
>
>John
>
>
>
>
>
Jakub Kicinski Feb. 1, 2024, 4:09 p.m. UTC | #4
On Thu, 1 Feb 2024 14:20:23 +0100 Jiri Pirko wrote:
> >BTW, I assume that changes like this are also ok:
> >
> >--------8<---------
> >
> >   net: team: Don't bother filling in ethtool driver version

Yup, just to be clear - you can send this independently from the series,
tag is as 

 [PATCH net-next]

we'll take it via the networking tree. I'm not sure which tree the other
patches will go thru..
John Garry Feb. 1, 2024, 4:20 p.m. UTC | #5
On 01/02/2024 16:09, Jakub Kicinski wrote:
> On Thu, 1 Feb 2024 14:20:23 +0100 Jiri Pirko wrote:
>>> BTW, I assume that changes like this are also ok:
>>>
>>> --------8<---------
>>>
>>>    net: team: Don't bother filling in ethtool driver version
> 
> Yup, just to be clear - you can send this independently from the series,

Sure, and I think rocker and staging/octeon also have this unnecessary 
code also.

> tag is as
> 
>   [PATCH net-next]

ah, yes

> 
> we'll take it via the networking tree.

Thanks. I assume Greg - the staging maintainer - would take the octeon 
patch.

> I'm not sure which tree the other
> patches will go thru..

I think that the best thing to do is get a minimal set in for 6.9 and 
then merge the rest in the next cycle. I've got about 22 patches in 
total now, but I think that there will be more. We'll see who can pick 
up the first set when I send it officially.

Thanks,
John
diff mbox series

Patch

diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c
index 7519b0818b91..81d052505f67 100644
--- a/net/ethtool/ioctl.c
+++ b/net/ethtool/ioctl.c
@@ -31,7 +31,7 @@ 
 #include <net/xdp_sock_drv.h>
 #include <net/flow_offload.h>
 #include <linux/ethtool_netlink.h>
-#include <generated/utsrelease.h>
+#include <linux/utsname.h>
 #include "common.h"
 
 /* State held across locks and calls for commands which have devlink fallback */
@@ -713,7 +713,7 @@  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, uts_release, sizeof(rsp->info.version));
 	if (ops->get_drvinfo) {
 		ops->get_drvinfo(dev, &rsp->info);
 		if (!rsp->info.bus_info[0] && parent)