From: Sven Eckelmann <sven@narfation.org>
To: Antonio Quartulli <a@unstable.cc>
Cc: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: remove forward declaration by including proper header
Date: Wed, 11 May 2016 12:38:31 +0200 [thread overview]
Message-ID: <2789203.91ASHWIDJV@bentobox> (raw)
In-Reply-To: <1462962557-23950-1-git-send-email-a@unstable.cc>
[-- Attachment #1: Type: text/plain, Size: 2063 bytes --]
On Wednesday 11 May 2016 18:29:16 Antonio Quartulli wrote:
> If main.h is included, the forward declaration for struct batadv_priv
> is not required.
>
> Cc: Sven Eckelmann <sven@narfation.org>
> Signed-off-by: Antonio Quartulli <a@unstable.cc>
> ---
>
> Sven, is there any special region for not having the include in this file ?
> It seems to be compiling just fine.
>
> Cheers,
We have some files which don't include main.h:
* net/batman-adv/bat_algo.h
* net/batman-adv/bat_v_ogm.h
* net/batman-adv/netlink.h
There is a special exception which should not include it to avoid cycles in
the includes:
* net/batman-adv/packet.h
The reason for the other three is just... there is no reason I can provide
other than it was not necessary for these files :). But if you want that to
have "main.h" included everywhere then please do it really everywhere:
diff --git a/net/batman-adv/bat_algo.h b/net/batman-adv/bat_algo.h
index 03dafd3..b727762 100644
--- a/net/batman-adv/bat_algo.h
+++ b/net/batman-adv/bat_algo.h
@@ -18,7 +18,7 @@
#ifndef _NET_BATMAN_ADV_BAT_ALGO_H_
#define _NET_BATMAN_ADV_BAT_ALGO_H_
-struct batadv_priv;
+#include "main.h"
int batadv_iv_init(void);
diff --git a/net/batman-adv/bat_v_ogm.h b/net/batman-adv/bat_v_ogm.h
index d849c75..4c4d45c 100644
--- a/net/batman-adv/bat_v_ogm.h
+++ b/net/batman-adv/bat_v_ogm.h
@@ -18,10 +18,10 @@
#ifndef _BATMAN_ADV_BATADV_V_OGM_H_
#define _BATMAN_ADV_BATADV_V_OGM_H_
+#include "main.h"
+
#include <linux/types.h>
-struct batadv_hard_iface;
-struct batadv_priv;
struct sk_buff;
int batadv_v_ogm_init(struct batadv_priv *bat_priv);
diff --git a/net/batman-adv/netlink.h b/net/batman-adv/netlink.h
index fa152a8..39044cc 100644
--- a/net/batman-adv/netlink.h
+++ b/net/batman-adv/netlink.h
@@ -18,6 +18,8 @@
#ifndef _NET_BATMAN_ADV_NETLINK_H_
#define _NET_BATMAN_ADV_NETLINK_H_
+#include "main.h"
+
void batadv_netlink_register(void);
void batadv_netlink_unregister(void);
Kind regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-05-11 10:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-11 10:29 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: remove forward declaration by including proper header Antonio Quartulli
2016-05-11 10:29 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: B.A.T.M.A.N. V - implement hard-iface init function Antonio Quartulli
2016-05-11 13:11 ` Sven Eckelmann
2016-05-11 21:14 ` Antonio Quartulli
2016-05-11 10:38 ` Sven Eckelmann [this message]
2016-05-11 10:47 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: remove forward declaration by including proper header Antonio Quartulli
2016-05-11 12:24 ` Sven Eckelmann
2016-05-12 21:07 ` Antonio Quartulli
2016-05-12 22:45 ` Sven Eckelmann
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=2789203.91ASHWIDJV@bentobox \
--to=sven@narfation.org \
--cc=a@unstable.cc \
--cc=b.a.t.m.a.n@lists.open-mesh.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.