Thread (1 message) 1 message, 1 author, 2023-03-30

Re: [PATCH 02/16] virtio_net: move struct to header file

From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Date: 2023-03-30 06:04:54
Also in: bpf, netdev

On Wed, 29 Mar 2023 21:18:26 -0700, Jakub Kicinski [off-list ref] wrote:
On Tue, 28 Mar 2023 17:28:33 +0800 Xuan Zhuo wrote:
quoted
diff --git a/drivers/net/virtio/virtnet.h b/drivers/net/virtio/virtnet.h
new file mode 100644
index 000000000000..778a0e6af869
--- /dev/null
+++ b/drivers/net/virtio/virtnet.h
@@ -0,0 +1,184 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef __VIRTNET_H__
+#define __VIRTNET_H__
+
+#include <linux/ethtool.h>
+#include <linux/average.h>
I don't want to nit pick too much but this header is missing a lot of
includes / forward declarations. At the same time on a quick look I
didn't spot anything that'd require linux/ethtool.h
Indeed, I only considered the compilation may pass before, and I didn't think
about it from the perspective of an independent header file.

Will fix.
quoted
diff --git a/drivers/net/virtio/virtnet.c b/drivers/net/virtio/virtnet.c
index e2560b6f7980..5ca354e29483 100644
--- a/drivers/net/virtio/virtnet.c
+++ b/drivers/net/virtio/virtnet.c
@@ -6,7 +6,6 @@
 //#define DEBUG
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
-#include <linux/ethtool.h>
 #include <linux/module.h>
 #include <linux/virtio.h>
 #include <linux/virtio_net.h>
@@ -16,13 +15,14 @@
 #include <linux/if_vlan.h>
 #include <linux/slab.h>
 #include <linux/cpu.h>
-#include <linux/average.h>
 #include <linux/filter.h>
 #include <linux/kernel.h>
 #include <net/route.h>
 #include <net/xdp.h>
 #include <net/net_failover.h>
And you shouldn't remove includes if the code needs them just because
they get pulled in indirectly.

Will fix.

Thanks.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help