From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Cc: netdev@vger.kernel.org, linux-usb@vger.kernel.org,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Peter Korsgaard" <peter@korsgaard.com>,
"Petko Manolov" <petkan@nucleusys.com>,
"Nikita Zhandarovich" <n.zhandarovich@fintech.ru>,
"Oliver Neukum" <oneukum@suse.com>,
"Krzysztof Hałasa" <khalasa@piap.pl>,
"Deepanshu Kartikey" <kartikey406@gmail.com>,
"Oleksij Rempel" <o.rempel@pengutronix.de>,
"Max Schulze" <max.schulze@online.de>,
"Thomas Gleixner" <tglx@kernel.org>,
"Ingo Molnar" <mingo@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
"Kees Cook" <kees@kernel.org>,
"Eric Biggers" <ebiggers@google.com>
Subject: Re: [PATCH net-next] net: usb: remove unnecessary get_drvinfo code and driver versions
Date: Sat, 24 Jan 2026 12:06:29 +0200 [thread overview]
Message-ID: <aXSZpWJnfuzpDX-C@smile.fi.intel.com> (raw)
In-Reply-To: <20260124092423.97481-1-enelsonmoore@gmail.com>
On Sat, Jan 24, 2026 at 01:23:26AM -0800, Ethan Nelson-Moore wrote:
> Many USB network drivers define get_drvinfo functions which add no
> value over usbnet_get_drvinfo, only setting the driver name and
> version. usbnet_get_drvinfo automatically sets the driver name, and
> separate driver versions are now frowned upon in the kernel. Remove all
> driver versions and replace these get_drvinfo functions with references
> to usbnet_get_drvinfo where possible. Where that is not possible,
> remove unnecessary code to set the driver name. Also remove two
> unnecessary initializations from aqc111_get_drvinfo, an inaccurate
> comment in pegasus.c, and an unused macro in catc.c.
FWIW,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
...
> static void catc_get_drvinfo(struct net_device *dev,
> {
> struct catc *catc = netdev_priv(dev);
> strscpy(info->driver, driver_name, sizeof(info->driver));
Side note: and we usually require blank line after the definition block.
On top, strscpy() in such cases can be improved to use 2-arguments variant,
as it adds a check for the destination to be an array.
> - strscpy(info->version, DRIVER_VERSION, sizeof(info->version));
> usb_make_path(catc->usbdev, info->bus_info, sizeof(info->bus_info));
> }
...
> static void rtl8152_get_drvinfo(struct net_device *netdev,
> struct r8152 *tp = netdev_priv(netdev);
>
> strscpy(info->driver, MODULENAME, sizeof(info->driver));
Ditto.
> - strscpy(info->version, DRIVER_VERSION, sizeof(info->version));
> usb_make_path(tp->udev, info->bus_info, sizeof(info->bus_info));
> if (!IS_ERR_OR_NULL(tp->rtl_fw.fw))
> strscpy(info->fw_version, tp->rtl_fw.version,
Seems the same, and so on...
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-01-24 10:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-24 9:23 [PATCH net-next] net: usb: remove unnecessary get_drvinfo code and driver versions Ethan Nelson-Moore
2026-01-24 10:06 ` Andy Shevchenko [this message]
2026-01-24 18:55 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aXSZpWJnfuzpDX-C@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=ebiggers@google.com \
--cc=edumazet@google.com \
--cc=enelsonmoore@gmail.com \
--cc=gustavoars@kernel.org \
--cc=kartikey406@gmail.com \
--cc=kees@kernel.org \
--cc=khalasa@piap.pl \
--cc=kuba@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=max.schulze@online.de \
--cc=mingo@kernel.org \
--cc=n.zhandarovich@fintech.ru \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=oneukum@suse.com \
--cc=pabeni@redhat.com \
--cc=peter@korsgaard.com \
--cc=petkan@nucleusys.com \
--cc=tglx@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox