Skip to contentSkip to conversation

batman-adv: remove useless forward declarations

PATCH Applied Antonio Quartulli 3 participants 7 messages May 21, 2016 – Jun 6, 2016 Batman advanced

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 batman-adv: remove useless forward declarations

If main.h is included, the batman-adv private forward declarations are not needed anymore. Remove them.

---
 net/batman-adv/gateway_client.h | 1 -
 net/batman-adv/icmp_socket.h    | 2 --
 2 files changed, 3 deletions(-)
net/batman-adv/gateway_client.h +0 -1
index 582dd8c..c74aca5 100644
@@ -22,7 +22,6 @@
 
 #include <linux/types.h>
 
-struct batadv_tvlv_gateway_data;
 struct seq_file;
 struct sk_buff;
 
net/batman-adv/icmp_socket.h +0 -2
index 618d5de..ce3ed25 100644
@@ -22,8 +22,6 @@
 
 #include <linux/types.h>
 
-struct batadv_icmp_header;
-
 #define BATADV_ICMP_SOCKET "socket"
 
 void batadv_socket_init(void);
Signature · 1 line
2.8.3
#1 lore raw

PATCH 2/2 batman-adv: move include line at the same place as other files

main.h is always included after the #ifdef guard except for bat_v_elp.h. Move it at the right place.

---
 net/batman-adv/bat_v_elp.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/batman-adv/bat_v_elp.h +2 -2
index cc130b2..be17c0b 100644
@@ -15,11 +15,11 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "main.h"
-
 #ifndef _NET_BATMAN_ADV_BAT_V_ELP_H_
 #define _NET_BATMAN_ADV_BAT_V_ELP_H_
 
+#include "main.h"
+
 struct sk_buff;
 struct work_struct;
 
Signature · 1 line
2.8.3
maintainer
#4 lore raw
In reply to Antonio Quartulli
Quoted 2 lines · On Saturday 21 May 2016 20:17:55 Antonio Quartulli wrote:

If main.h is included, the batman-adv private forward declarations are not needed anymore. Remove them.

No, these are defined in packet.h and not main.h/types.h

Kind regards,
Sven

Quoted 29 lines
 net/batman-adv/gateway_client.h | 1 -
 net/batman-adv/icmp_socket.h    | 2 --
 2 files changed, 3 deletions(-)
(quoted diff) +0 -0

b/net/batman-adv/gateway_client.h index 582dd8c..c74aca5 100644

net/batman-adv/gateway_client.h +0 -1
@@ -22,7 +22,6 @@
 
 #include <linux/types.h>
 
-struct batadv_tvlv_gateway_data;
 struct seq_file;
 struct sk_buff;
 
net/batman-adv/icmp_socket.h +0 -2
index 618d5de..ce3ed25 100644
@@ -22,8 +22,6 @@
 
 #include <linux/types.h>
 
-struct batadv_icmp_header;
-
 #define BATADV_ICMP_SOCKET "socket"
 
 void batadv_socket_init(void);
maintainer Reviewed-by on v1 2/2
#2 lore raw

Re: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: move include line at the same place as other files

In reply to Antonio Quartulli
Quoted 6 lines · On Saturday 21 May 2016 20:17:56 Antonio Quartulli wrote:

main.h is always included after the #ifdef guard except for bat_v_elp.h. Move it at the right place.

---

Good find :)

Kind regards,
Sven

Quoted 20 lines
 net/batman-adv/bat_v_elp.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/batman-adv/bat_v_elp.h +2 -2
index cc130b2..be17c0b 100644
@@ -15,11 +15,11 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "main.h"
-
 #ifndef _NET_BATMAN_ADV_BAT_V_ELP_H_
 #define _NET_BATMAN_ADV_BAT_V_ELP_H_
 
+#include "main.h"
+
 struct sk_buff;
 struct work_struct;
#5 lore raw
In reply to Sven Eckelmann
Quoted 5 lines · Sven Eckelmann
Quoted 2 lines · On Saturday 21 May 2016 20:17:55 Antonio Quartulli wrote:

If main.h is included, the batman-adv private forward declarations are not needed anymore. Remove them.

No, these are defined in packet.h and not main.h/types.h

Right. This single patch can be dropped then.

Cheers,

Signature · 1 line
Antonio Quartulli
#6 lore raw
In reply to Antonio Quartulli
Quoted 9 lines · On Saturday, May 21, 2016 20:17:55 Antonio Quartulli wrote:

If main.h is included, the batman-adv private forward declarations are not needed anymore. Remove them.

---
 net/batman-adv/gateway_client.h | 1 -
 net/batman-adv/icmp_socket.h    | 2 --
 2 files changed, 3 deletions(-)

Applied in revision 563823d.

Thanks,
Marek

#3 lore raw

Re: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: move include line at the same place as other files

In reply to Sven Eckelmann
Quoted 6 lines · On Saturday, May 21, 2016 14:32:38 Sven Eckelmann wrote:

Signed by [email protected]. Show Details

Quoted 3 lines · On Saturday 21 May 2016 20:17:56 Antonio Quartulli wrote:

main.h is always included after the #ifdef guard except for bat_v_elp.h. Move it at the right place.

Quoted 7 lines
Quoted 3 lines

---

Good find

Applied in revision f47544c.

Thanks,
Marek