Skip to contentSkip to conversation

net: 8021q: remove unneeded MODULE_VERSION() usage

PATCH In review Enrico Weigelt, metux IT consult 7 participants 16 messages Jan 4, 2020 – Jan 5, 2020

Subsystems (13)
lore
Share & tools
lore
#0 lore raw

PATCH 1/8 net: 8021q: remove unneeded MODULE_VERSION() usage

Remove MODULE_VERSION(), as it isn't needed at all: the only version making sense is the kernel version.

---
 net/8021q/vlan.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
net/8021q/vlan.c +1 -7
index d4bcfd8f95bf..ded7bf7229cf 100644
@@ -36,15 +36,10 @@
 #include "vlan.h"
 #include "vlanproc.h"
 
-#define DRV_VERSION "1.8"
-
 /* Global VLAN variables */
 
 unsigned int vlan_net_id __read_mostly;
 
-const char vlan_fullname[] = "802.1Q VLAN Support";
-const char vlan_version[] = DRV_VERSION;
-
 /* End of global variables definitions. */
 
 static int vlan_group_prealloc_vid(struct vlan_group *vg,
@@ -683,7 +678,7 @@ static int __init vlan_proto_init(void)
 {
 	int err;
 
-	pr_info("%s v%s\n", vlan_fullname, vlan_version);
+	pr_info("802.1Q VLAN Support\n");
 
 	err = register_pernet_subsys(&vlan_net_ops);
 	if (err < 0)
@@ -739,4 +734,3 @@ module_init(vlan_proto_init);
 module_exit(vlan_cleanup_module);
 
 MODULE_LICENSE("GPL");
-MODULE_VERSION(DRV_VERSION);
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/8 net: 8021q: use netdev_info()/netdev_warn()

Use netdev_info() / netdev_warn() instead of pr_info() / pr_warn() for more consistent log output.

---
 net/8021q/vlan.c      | 4 ++--
 net/8021q/vlan_core.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
net/8021q/vlan.c +2 -2
index ded7bf7229cf..7f18c8406ff8 100644
@@ -123,7 +123,7 @@ int vlan_check_real_dev(struct net_device *real_dev,
 	const char *name = real_dev->name;
 
 	if (real_dev->features & NETIF_F_VLAN_CHALLENGED) {
-		pr_info("VLANs not supported on %s\n", name);
+		netdev_info(real_dev, "VLANs not supported on %s\n", name);
 		NL_SET_ERR_MSG_MOD(extack, "VLANs not supported on device");
 		return -EOPNOTSUPP;
 	}
@@ -376,7 +376,7 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
 
 	if ((event == NETDEV_UP) &&
 	    (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) {
-		pr_info("adding VLAN 0 to HW filter on device %s\n",
+		netdev_info(dev, "adding VLAN 0 to HW filter on device %s\n",
 			dev->name);
 		vlan_vid_add(dev, htons(ETH_P_8021Q), 0);
 	}
net/8021q/vlan_core.c +1 -1
index a313165e7a67..bc32b33e0da8 100644
@@ -360,7 +360,7 @@ static void __vlan_vid_del(struct vlan_info *vlan_info,
 
 	err = vlan_kill_rx_filter_info(dev, proto, vid);
 	if (err)
-		pr_warn("failed to kill vid %04x/%d for device %s\n",
+		netdev_warn(dev, "failed to kill vid %04x/%d for device %s\n",
 			proto, vid, dev->name);
 
 	list_del(&vid_info->list);
Signature · 1 line
2.11.0
#2 lore raw

Re: [PATCH 2/8] net: 8021q: use netdev_info()/netdev_warn()

Quoted 14 lines · metux IT consult

Use netdev_info() / netdev_warn() instead of pr_info() / pr_warn() for more consistent log output.

---
 net/8021q/vlan.c      | 4 ++--
 net/8021q/vlan_core.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
net/8021q/vlan.c +0 -0
index ded7bf7229cf..7f18c8406ff8 100644

net/8021q/vlan.c int vlan_check_real_dev(struct net_device *real_dev, · line 126

Quoted 5 lines
net/8021q/vlan.c +1 -1
@@ -123,7 +123,7 @@ int vlan_check_real_dev(struct net_device *real_dev,
 	const char *name = real_dev->name;
 
 	if (real_dev->features & NETIF_F_VLAN_CHALLENGED) {
-		pr_info("VLANs not supported on %s\n", name);
+		netdev_info(real_dev, "VLANs not supported on %s\n", name);

Since we use netdev_info which does internally use net_device::name for printing, the name argument is now redundant.

net/8021q/vlan.c static int vlan_device_event(struct notifier_block *unused, unsigned long event, · line 380

Quoted 10 lines
net/8021q/vlan.c +1 -1
 		NL_SET_ERR_MSG_MOD(extack, "VLANs not supported on device");
 		return -EOPNOTSUPP;
 	}
@@ -376,7 +376,7 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
 
 	if ((event == NETDEV_UP) &&
 	    (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) {
-		pr_info("adding VLAN 0 to HW filter on device %s\n",
+		netdev_info(dev, "adding VLAN 0 to HW filter on device %s\n",
 			dev->name);

Likewise.

net/8021q/vlan_core.c static void __vlan_vid_del(struct vlan_info *vlan_info, · line 364

Quoted 13 lines
net/8021q/vlan.c +0 -0
 		vlan_vid_add(dev, htons(ETH_P_8021Q), 0);
 	}
net/8021q/vlan_core.c +1 -1
index a313165e7a67..bc32b33e0da8 100644
@@ -360,7 +360,7 @@ static void __vlan_vid_del(struct vlan_info *vlan_info,
 
 	err = vlan_kill_rx_filter_info(dev, proto, vid);
 	if (err)
-		pr_warn("failed to kill vid %04x/%d for device %s\n",
+		netdev_warn(dev, "failed to kill vid %04x/%d for device %s\n",
 			proto, vid, dev->name);

And here as well.

Signature · 1 line
Florian
#3 lore raw

PATCH 3/8 net: batman-adv: remove unneeded MODULE_VERSION() usage

In reply to Enrico Weigelt, metux IT consult

Remove MODULE_VERSION(), as it isn't needed at all: the only version making sense is the kernel version.

---
 net/batman-adv/main.c | 1 -
 1 file changed, 1 deletion(-)
net/batman-adv/main.c +0 -1
index 4811ec65bc43..8ccca3734b7a 100644
@@ -748,6 +748,5 @@ MODULE_LICENSE("GPL");
 MODULE_AUTHOR(BATADV_DRIVER_AUTHOR);
 MODULE_DESCRIPTION(BATADV_DRIVER_DESC);
 MODULE_SUPPORTED_DEVICE(BATADV_DRIVER_DEVICE);
-MODULE_VERSION(BATADV_SOURCE_VERSION);
 MODULE_ALIAS_RTNL_LINK("batadv");
 MODULE_ALIAS_GENL_FAMILY(BATADV_NL_NAME);
Signature · 1 line
2.11.0
maintainer
#4 lore raw

Re: [PATCH 3/8] net: batman-adv: remove unneeded MODULE_VERSION() usage

Quoted 5 lines · metux IT consult

Remove MODULE_VERSION(), as it isn't needed at all: the only version making sense is the kernel version.

---

While it is not strictly required, there are still some consumers that need this information to detect the version when installing various modules via backports.

Kind regards,
Sven

#5 lore raw

PATCH 4/8 net: ipv4: use netdev_info()/netdev_warn()

In reply to Enrico Weigelt, metux IT consult

Use netdev_info() / netdev_warn() instead of pr_info() / pr_warn() for more consistent log output.

---
 net/ipv4/tcp_cubic.c    | 1 -
 net/ipv4/tcp_illinois.c | 1 -
 net/ipv4/tcp_nv.c       | 1 -
 3 files changed, 3 deletions(-)
net/ipv4/tcp_cubic.c +0 -1
index 1b3d032a4df2..83fda965186d 100644
@@ -513,4 +513,3 @@ module_exit(cubictcp_unregister);
 MODULE_AUTHOR("Sangtae Ha, Stephen Hemminger");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("CUBIC TCP");
-MODULE_VERSION("2.3");
net/ipv4/tcp_illinois.c +0 -1
index 00e54873213e..8cc9967e82ef 100644
@@ -355,4 +355,3 @@ module_exit(tcp_illinois_unregister);
 MODULE_AUTHOR("Stephen Hemminger, Shao Liu");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("TCP Illinois");
-MODULE_VERSION("1.0");
net/ipv4/tcp_nv.c +0 -1
index 95db7a11ba2a..b3879fb24d33 100644
@@ -499,4 +499,3 @@ module_exit(tcpnv_unregister);
 MODULE_AUTHOR("Lawrence Brakmo");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("TCP NV");
-MODULE_VERSION("1.0");
Signature · 1 line
2.11.0
maintainer
#6 lore raw

Re: [PATCH 4/8] net: ipv4: use netdev_info()/netdev_warn()

Quoted 5 lines · metux IT consult

Use netdev_info() / netdev_warn() instead of pr_info() / pr_warn() for more consistent log output.

---

Patch description has nothing to do with the actual patch.

Kind regards,
Sven

Quoted 33 lines
 net/ipv4/tcp_cubic.c    | 1 -
 net/ipv4/tcp_illinois.c | 1 -
 net/ipv4/tcp_nv.c       | 1 -
 3 files changed, 3 deletions(-)
net/ipv4/tcp_cubic.c +0 -1
index 1b3d032a4df2..83fda965186d 100644
@@ -513,4 +513,3 @@ module_exit(cubictcp_unregister);
 MODULE_AUTHOR("Sangtae Ha, Stephen Hemminger");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("CUBIC TCP");
-MODULE_VERSION("2.3");
net/ipv4/tcp_illinois.c +0 -1
index 00e54873213e..8cc9967e82ef 100644
@@ -355,4 +355,3 @@ module_exit(tcp_illinois_unregister);
 MODULE_AUTHOR("Stephen Hemminger, Shao Liu");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("TCP Illinois");
-MODULE_VERSION("1.0");
net/ipv4/tcp_nv.c +0 -1
index 95db7a11ba2a..b3879fb24d33 100644
@@ -499,4 +499,3 @@ module_exit(tcpnv_unregister);
 MODULE_AUTHOR("Lawrence Brakmo");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("TCP NV");
-MODULE_VERSION("1.0");
#7 lore raw

Re: [PATCH 4/8] net: ipv4: use netdev_info()/netdev_warn()

In reply to Enrico Weigelt, metux IT consult
Quoted 16 lines · metux IT consult

Use netdev_info() / netdev_warn() instead of pr_info() / pr_warn() for more consistent log output.

---
 net/ipv4/tcp_cubic.c    | 1 -
 net/ipv4/tcp_illinois.c | 1 -
 net/ipv4/tcp_nv.c       | 1 -
 3 files changed, 3 deletions(-)
net/ipv4/tcp_cubic.c +0 -0
index 1b3d032a4df2..83fda965186d 100644

net/ipv4/tcp_cubic.c module_exit(cubictcp_unregister); · line 516

Quoted 4 lines
net/ipv4/tcp_cubic.c +0 -1
@@ -513,4 +513,3 @@ module_exit(cubictcp_unregister);
 MODULE_AUTHOR("Sangtae Ha, Stephen Hemminger");
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("CUBIC TCP");
-MODULE_VERSION("2.3");

Commit message and code change do not match.

#8 lore raw

PATCH 5/8 net: bluetooth: remove unneeded MODULE_VERSION() usage

In reply to Enrico Weigelt, metux IT consult

Remove MODULE_VERSION(), as it isn't needed at all: the only version making sense is the kernel version.

---
 net/bluetooth/6lowpan.c      | 3 ---
 net/bluetooth/af_bluetooth.c | 1 -
 net/bluetooth/bnep/core.c    | 1 -
 net/bluetooth/cmtp/core.c    | 1 -
 net/bluetooth/hidp/core.c    | 1 -
 net/bluetooth/rfcomm/core.c  | 1 -
 6 files changed, 8 deletions(-)
net/bluetooth/6lowpan.c +0 -3
index 4febc82a7c76..76fabc65b8a9 100644
@@ -21,8 +21,6 @@
 
 #include <net/6lowpan.h> /* for the compression support */
 
-#define VERSION "0.1"
-
 static struct dentry *lowpan_enable_debugfs;
 static struct dentry *lowpan_control_debugfs;
 
@@ -1303,5 +1301,4 @@ module_exit(bt_6lowpan_exit);
 
 MODULE_AUTHOR("Jukka Rissanen <[email protected]>");
 MODULE_DESCRIPTION("Bluetooth 6LoWPAN");
-MODULE_VERSION(VERSION);
 MODULE_LICENSE("GPL");
net/bluetooth/af_bluetooth.c +0 -1
index 3fd124927d4d..1a6972fac1f7 100644
@@ -798,6 +798,5 @@ module_exit(bt_exit);
 
 MODULE_AUTHOR("Marcel Holtmann <[email protected]>");
 MODULE_DESCRIPTION("Bluetooth Core ver " VERSION);
-MODULE_VERSION(VERSION);
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_NETPROTO(PF_BLUETOOTH);
net/bluetooth/bnep/core.c +0 -1
index 43c284158f63..96f0eb60deb0 100644
@@ -764,6 +764,5 @@ MODULE_PARM_DESC(compress_dst, "Compress destination headers");
 
 MODULE_AUTHOR("Marcel Holtmann <[email protected]>");
 MODULE_DESCRIPTION("Bluetooth BNEP ver " VERSION);
-MODULE_VERSION(VERSION);
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("bt-proto-4");
net/bluetooth/cmtp/core.c +0 -1
index 07cfa3249f83..9a6306d7f738 100644
@@ -511,6 +511,5 @@ module_exit(cmtp_exit);
 
 MODULE_AUTHOR("Marcel Holtmann <[email protected]>");
 MODULE_DESCRIPTION("Bluetooth CMTP ver " VERSION);
-MODULE_VERSION(VERSION);
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("bt-proto-5");
net/bluetooth/hidp/core.c +0 -1
index bef84b95e2c4..a225ae5f1849 100644
@@ -1475,6 +1475,5 @@ module_exit(hidp_exit);
 MODULE_AUTHOR("Marcel Holtmann <[email protected]>");
 MODULE_AUTHOR("David Herrmann <[email protected]>");
 MODULE_DESCRIPTION("Bluetooth HIDP ver " VERSION);
-MODULE_VERSION(VERSION);
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("bt-proto-6");
net/bluetooth/rfcomm/core.c +0 -1
index 3a9e9d9670be..e621fbb451b3 100644
@@ -2245,6 +2245,5 @@ MODULE_PARM_DESC(l2cap_ertm, "Use L2CAP ERTM mode for connection");
 
 MODULE_AUTHOR("Marcel Holtmann <[email protected]>");
 MODULE_DESCRIPTION("Bluetooth RFCOMM ver " VERSION);
-MODULE_VERSION(VERSION);
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("bt-proto-3");
Signature · 1 line
2.11.0
maintainer
#9 lore raw

Re: [PATCH 5/8] net: bluetooth: remove unneeded MODULE_VERSION() usage

Hi Enrico,

Quoted 2 lines

Remove MODULE_VERSION(), as it isn't needed at all: the only version making sense is the kernel version.

I prefer to keep the MODULE_VERSION info since it provides this information via modinfo.

Unless there is a kernel wide consent to remove MODULE_VERSION altogether, the Bluetooth subsystem is keeping it.

Regards

Marcel

#10 lore raw

Re: [PATCH 5/8] net: bluetooth: remove unneeded MODULE_VERSION() usage

Quoted 7 lines · Marcel Holtmann

Hi Enrico,

Quoted 2 lines

Remove MODULE_VERSION(), as it isn't needed at all: the only version making sense is the kernel version.

I prefer to keep the MODULE_VERSION info since it provides this information via modinfo.

Sure, but it's really pointless :)

Quoted 2 lines

Unless there is a kernel wide consent to remove MODULE_VERSION altogether, the Bluetooth subsystem is keeping it.

I've deleted them from lots of drivers/subsystems already as they do not make any sense when you think about vendor kernels, stable kernels, and upstream kernel versions.

thanks,

greg k-h

#11 lore raw

PATCH 6/8 net: bridge: remove unneeded MODULE_VERSION() usage

In reply to Enrico Weigelt, metux IT consult

Remove MODULE_VERSION(), as it isn't needed at all: the only version making sense is the kernel version.

---
 net/bridge/br.c | 1 -
 1 file changed, 1 deletion(-)
net/bridge/br.c +0 -1
index b6fe30e3768f..6ecd3db3ab59 100644
@@ -394,5 +394,4 @@ static void __exit br_deinit(void)
 module_init(br_init)
 module_exit(br_deinit)
 MODULE_LICENSE("GPL");
-MODULE_VERSION(BR_VERSION);
 MODULE_ALIAS_RTNL_LINK("bridge");
Signature · 1 line
2.11.0
#12 lore raw

PATCH 7/8 net: vmw_vsock: remove unneeded MODULE_VERSION() usage

In reply to Enrico Weigelt, metux IT consult

Remove MODULE_VERSION(), as it isn't needed at all: the only version making sense is the kernel version.

---
 net/vmw_vsock/af_vsock.c         | 1 -
 net/vmw_vsock/hyperv_transport.c | 1 -
 net/vmw_vsock/vmci_transport.c   | 1 -
 3 files changed, 3 deletions(-)
net/vmw_vsock/af_vsock.c +0 -1
index 74db4cd637a7..7e0cd3220d42 100644
@@ -2203,5 +2203,4 @@ module_exit(vsock_exit);
 
 MODULE_AUTHOR("VMware, Inc.");
 MODULE_DESCRIPTION("VMware Virtual Socket Family");
-MODULE_VERSION("1.0.2.0-k");
 MODULE_LICENSE("GPL v2");
net/vmw_vsock/hyperv_transport.c +0 -1
index b3bdae74c243..f6cb66b62479 100644
@@ -985,6 +985,5 @@ module_init(hvs_init);
 module_exit(hvs_exit);
 
 MODULE_DESCRIPTION("Hyper-V Sockets");
-MODULE_VERSION("1.0.0");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_NETPROTO(PF_VSOCK);
net/vmw_vsock/vmci_transport.c +0 -1
index 644d32e43d23..f2f689b7ca9a 100644
@@ -2140,7 +2140,6 @@ module_exit(vmci_transport_exit);
 
 MODULE_AUTHOR("VMware, Inc.");
 MODULE_DESCRIPTION("VMCI transport for Virtual Sockets");
-MODULE_VERSION("1.0.5.0-k");
 MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("vmware_vsock");
 MODULE_ALIAS_NETPROTO(PF_VSOCK);
Signature · 1 line
2.11.0
#13 lore raw

PATCH 8/8 net: tipc: remove unneeded MODULE_VERSION() usage

In reply to Enrico Weigelt, metux IT consult

Remove MODULE_VERSION(), as it isn't needed at all: the only version making sense is the kernel version.

---
 net/tipc/core.c | 1 -
 1 file changed, 1 deletion(-)
net/tipc/core.c +0 -1
index 4f6dc74adf45..98dbc18a0dd8 100644
@@ -221,4 +221,3 @@ module_exit(tipc_exit);
 
 MODULE_DESCRIPTION("TIPC: Transparent Inter Process Communication");
 MODULE_LICENSE("Dual BSD/GPL");
-MODULE_VERSION(TIPC_MOD_VER);
Signature · 1 line
2.11.0
#14 lore raw
In reply to Enrico Weigelt, metux IT consult
I love your patch! Yet something to improve:

Hi "Enrico,

I love your patch! Yet something to improve:

[auto build test ERROR on net/master]
[also build test ERROR on net-next/master v5.5-rc4 next-20191220] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Enrico-Weigelt-metux-IT-consult/net-8021q-remove-unneeded-MODULE_VERSION-usage/20200105-075730
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git b54ef37b1ce892fdf6b632d566246d2f2f539910
config: alpha-defconfig (attached as .config)
compiler: alpha-linux-gcc (GCC) 7.5.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=alpha

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

>> ERROR: "vlan_fullname" [net/8021q/8021q.ko] undefined!
>> ERROR: "vlan_version" [net/8021q/8021q.ko] undefined!

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

#15 lore raw
In reply to Enrico Weigelt, metux IT consult
I love your patch! Yet something to improve:

Hi "Enrico,

I love your patch! Yet something to improve:

[auto build test ERROR on net/master]
[also build test ERROR on net-next/master v5.5-rc4 next-20191220] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Enrico-Weigelt-metux-IT-consult/net-8021q-remove-unneeded-MODULE_VERSION-usage/20200105-075730
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git b54ef37b1ce892fdf6b632d566246d2f2f539910
config: x86_64-randconfig-e001-20200105 (attached as .config)
compiler: gcc-7 (Debian 7.5.0-3) 7.5.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

ld: net/8021q/vlan_dev.o: in function `vlan_ethtool_get_drvinfo':
vlan_dev.c:(.text+0x10a): undefined reference to `vlan_fullname'

>> ld: vlan_dev.c:(.text+0x11f): undefined reference to `vlan_version'

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation