Thread (117 messages) 117 messages, 5 authors, 2024-07-18

Re: [PATCH net-next v3 11/24] ovpn: implement packet processing

From: Andrew Lunn <andrew@lunn.ch>
Date: 2024-05-22 14:28:41

On Wed, May 22, 2024 at 04:08:44PM +0200, Antonio Quartulli wrote:
On 12/05/2024 10:46, Sabrina Dubroca wrote:
quoted
2024-05-06, 03:16:24 +0200, Antonio Quartulli wrote:
quoted
diff --git a/drivers/net/ovpn/bind.c b/drivers/net/ovpn/bind.c
index c1f842c06e32..7240d1036fb7 100644
--- a/drivers/net/ovpn/bind.c
+++ b/drivers/net/ovpn/bind.c
@@ -13,6 +13,7 @@
  #include "ovpnstruct.h"
  #include "io.h"
  #include "bind.h"
+#include "packet.h"
  #include "peer.h"
You have a few hunks like that in this patch, adding an include to a
file that is otherwise not being modified. That's odd.
I just went through this and there is a reason for these extra includes.

Basically this patch is modifying peer.h so that it now requires packet.h as
dependency.

To reduce the includes complexity I am adding as many includes as possible
to .c files only, therefore the dependency needs to appear in every .c file
including peer.h, rather than adding the include to peer.h itself.

This was my interpretation of Andrew Lunn's suggestion, but I may have got
it too extreme.
It becomes an issue when adding one include pulls in 10s to 100s of
other includes, 99% of which are not needed and just slows down the
compile. With our own local headers, this is probably not going to
happen.

Try using

make foo/bar/foobar.i

which will run cpp on foobar.c and produce foobar.i. You can then see
the effects of the additional include. If it is minimum, you don't
need to care much, and could always include it.

     Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help