diff mbox series

[2/3] sunhme: fix the version number in struct ethtool_drvinfo

Message ID 3152336.aeNJFYEL58@eto.sf-tec.de (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [1/3] sunhme: remove unused tx_dump_ring() | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter warning Series does not have a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers fail 1 blamed authors not CCed: davem@davemloft.net; 3 maintainers not CCed: davem@davemloft.net kuba@kernel.org christophe.jaillet@wanadoo.fr
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes fail Problems with Fixes tag: 1
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch warning WARNING: Prefer strscpy over strlcpy - see: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Rolf Eike Beer Feb. 3, 2022, 4:22 p.m. UTC
Fixes: 050bbb196392b9c178f82b1205a23dd2f915ee93
Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
---
 drivers/net/ethernet/sun/sunhme.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Andrew Lunn Feb. 3, 2022, 5:12 p.m. UTC | #1
On Thu, Feb 03, 2022 at 05:22:23PM +0100, Rolf Eike Beer wrote:
> Fixes: 050bbb196392b9c178f82b1205a23dd2f915ee93
> Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
> ---
>  drivers/net/ethernet/sun/sunhme.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
> index 22abfe58f728..43834339bb43 100644
> --- a/drivers/net/ethernet/sun/sunhme.c
> +++ b/drivers/net/ethernet/sun/sunhme.c
> @@ -2470,8 +2470,8 @@ static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info
>  {
>  	struct happy_meal *hp = netdev_priv(dev);
>  
> -	strlcpy(info->driver, "sunhme", sizeof(info->driver));
> -	strlcpy(info->version, "2.02", sizeof(info->version));
> +	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
> +	strlcpy(info->version, DRV_VERSION, sizeof(info->version));

I would suggest you drop setting info->version. The kernel will fill
it with the current kernel version, which is much more meaningful.

   Andrew
Jakub Kicinski Feb. 3, 2022, 9:53 p.m. UTC | #2
On Thu, 03 Feb 2022 17:22:23 +0100 Rolf Eike Beer wrote:
> Fixes: 050bbb196392b9c178f82b1205a23dd2f915ee93

This is not the correct format for a fixes tag, FWIW.
Rolf Eike Beer Feb. 5, 2022, 11:27 a.m. UTC | #3
Am Donnerstag, 3. Februar 2022, 18:12:40 CET schrieb Andrew Lunn:
> On Thu, Feb 03, 2022 at 05:22:23PM +0100, Rolf Eike Beer wrote:
> > Fixes: 050bbb196392b9c178f82b1205a23dd2f915ee93
> > Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
> > ---
> > 
> >  drivers/net/ethernet/sun/sunhme.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/sun/sunhme.c
> > b/drivers/net/ethernet/sun/sunhme.c index 22abfe58f728..43834339bb43
> > 100644
> > --- a/drivers/net/ethernet/sun/sunhme.c
> > +++ b/drivers/net/ethernet/sun/sunhme.c
> > @@ -2470,8 +2470,8 @@ static void hme_get_drvinfo(struct net_device *dev,
> > struct ethtool_drvinfo *info> 
> >  {
> >  
> >  	struct happy_meal *hp = netdev_priv(dev);
> > 
> > -	strlcpy(info->driver, "sunhme", sizeof(info->driver));
> > -	strlcpy(info->version, "2.02", sizeof(info->version));
> > +	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
> > +	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
> 
> I would suggest you drop setting info->version. The kernel will fill
> it with the current kernel version, which is much more meaningful.

Would it make sense to completely remove the version number from the driver 
then?

Eike
Andrew Lunn Feb. 5, 2022, 2:48 p.m. UTC | #4
> > > struct ethtool_drvinfo *info> 
> > >  {
> > >  
> > >  	struct happy_meal *hp = netdev_priv(dev);
> > > 
> > > -	strlcpy(info->driver, "sunhme", sizeof(info->driver));
> > > -	strlcpy(info->version, "2.02", sizeof(info->version));
> > > +	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
> > > +	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
> > 
> > I would suggest you drop setting info->version. The kernel will fill
> > it with the current kernel version, which is much more meaningful.
> 
> Would it make sense to completely remove the version number from the driver 
> then?

If it is not used anywhere else, yes, you can remove it.

   Andrew
Rolf Eike Beer Feb. 5, 2022, 3:57 p.m. UTC | #5
Am Samstag, 5. Februar 2022, 15:48:41 CET schrieb Andrew Lunn:
> > > > struct ethtool_drvinfo *info>
> > > > 
> > > >  {
> > > >  
> > > >  	struct happy_meal *hp = netdev_priv(dev);
> > > > 
> > > > -	strlcpy(info->driver, "sunhme", sizeof(info->driver));
> > > > -	strlcpy(info->version, "2.02", sizeof(info->version));
> > > > +	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
> > > > +	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
> > > 
> > > I would suggest you drop setting info->version. The kernel will fill
> > > it with the current kernel version, which is much more meaningful.
> > 
> > Would it make sense to completely remove the version number from the
> > driver
> > then?
> 
> If it is not used anywhere else, yes, you can remove it.

Of course it prints the number on module load… but otherwise it does nothing 
with it.
Andrew Lunn Feb. 5, 2022, 4:32 p.m. UTC | #6
> > If it is not used anywhere else, yes, you can remove it.
> 
> Of course it prints the number on module load… but otherwise it does nothing 
> with it.

You could remove that as well.

The basic problem is, the version string does not identify the sources
with enough accuracy. It says nothing about back ported fixes in
stable kernels. It tells you nothing about vendor patches to the
network core, etc.

	Andrew
diff mbox series

Patch

diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
index 22abfe58f728..43834339bb43 100644
--- a/drivers/net/ethernet/sun/sunhme.c
+++ b/drivers/net/ethernet/sun/sunhme.c
@@ -2470,8 +2470,8 @@  static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info
 {
 	struct happy_meal *hp = netdev_priv(dev);
 
-	strlcpy(info->driver, "sunhme", sizeof(info->driver));
-	strlcpy(info->version, "2.02", sizeof(info->version));
+	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
+	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
 	if (hp->happy_flags & HFLAG_PCI) {
 		struct pci_dev *pdev = hp->happy_dev;
 		strlcpy(info->bus_info, pci_name(pdev), sizeof(info->bus_info));