aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2011-01-15 09:39:43 -0500
committerSven Eckelmann <sven@narfation.org>2011-01-15 21:25:19 -0500
commitaa0adb1a85e159cf57f0e11282bc6c9e3606a5f3 (patch)
tree19406bf80804801e85cf0182f5037ddfc656465e /net
parented7809d9c41b514115ddffaa860694393c2016b3 (diff)
batman-adv: Use "__attribute__" shortcut macros
Linux 2.6.21 defines different macros for __attribute__ which are also used inside batman-adv. The next version of checkpatch.pl warns about the usage of __attribute__((packed))). Linux 2.6.33 defines an extra macro __always_unused which is used to assist source code analyzers and can be used to removed the last existing __attribute__ inside the source code. Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/main.h6
-rw-r--r--net/batman-adv/packet.h14
-rw-r--r--net/batman-adv/types.h4
3 files changed, 12 insertions, 12 deletions
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index d4d9926c2201..65106fb61b8f 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -151,9 +151,9 @@ int debug_log(struct bat_priv *bat_priv, char *fmt, ...);
151 } \ 151 } \
152 while (0) 152 while (0)
153#else /* !CONFIG_BATMAN_ADV_DEBUG */ 153#else /* !CONFIG_BATMAN_ADV_DEBUG */
154static inline void bat_dbg(char type __attribute__((unused)), 154static inline void bat_dbg(char type __always_unused,
155 struct bat_priv *bat_priv __attribute__((unused)), 155 struct bat_priv *bat_priv __always_unused,
156 char *fmt __attribute__((unused)), ...) 156 char *fmt __always_unused, ...)
157{ 157{
158} 158}
159#endif 159#endif
diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h
index b49fdf70a6d5..2284e8129cb2 100644
--- a/net/batman-adv/packet.h
+++ b/net/batman-adv/packet.h
@@ -63,7 +63,7 @@ struct batman_packet {
63 uint8_t num_hna; 63 uint8_t num_hna;
64 uint8_t gw_flags; /* flags related to gateway class */ 64 uint8_t gw_flags; /* flags related to gateway class */
65 uint8_t align; 65 uint8_t align;
66} __attribute__((packed)); 66} __packed;
67 67
68#define BAT_PACKET_LEN sizeof(struct batman_packet) 68#define BAT_PACKET_LEN sizeof(struct batman_packet)
69 69
@@ -76,7 +76,7 @@ struct icmp_packet {
76 uint8_t orig[6]; 76 uint8_t orig[6];
77 uint16_t seqno; 77 uint16_t seqno;
78 uint8_t uid; 78 uint8_t uid;
79} __attribute__((packed)); 79} __packed;
80 80
81#define BAT_RR_LEN 16 81#define BAT_RR_LEN 16
82 82
@@ -93,14 +93,14 @@ struct icmp_packet_rr {
93 uint8_t uid; 93 uint8_t uid;
94 uint8_t rr_cur; 94 uint8_t rr_cur;
95 uint8_t rr[BAT_RR_LEN][ETH_ALEN]; 95 uint8_t rr[BAT_RR_LEN][ETH_ALEN];
96} __attribute__((packed)); 96} __packed;
97 97
98struct unicast_packet { 98struct unicast_packet {
99 uint8_t packet_type; 99 uint8_t packet_type;
100 uint8_t version; /* batman version field */ 100 uint8_t version; /* batman version field */
101 uint8_t dest[6]; 101 uint8_t dest[6];
102 uint8_t ttl; 102 uint8_t ttl;
103} __attribute__((packed)); 103} __packed;
104 104
105struct unicast_frag_packet { 105struct unicast_frag_packet {
106 uint8_t packet_type; 106 uint8_t packet_type;
@@ -110,7 +110,7 @@ struct unicast_frag_packet {
110 uint8_t flags; 110 uint8_t flags;
111 uint8_t orig[6]; 111 uint8_t orig[6];
112 uint16_t seqno; 112 uint16_t seqno;
113} __attribute__((packed)); 113} __packed;
114 114
115struct bcast_packet { 115struct bcast_packet {
116 uint8_t packet_type; 116 uint8_t packet_type;
@@ -118,7 +118,7 @@ struct bcast_packet {
118 uint8_t orig[6]; 118 uint8_t orig[6];
119 uint8_t ttl; 119 uint8_t ttl;
120 uint32_t seqno; 120 uint32_t seqno;
121} __attribute__((packed)); 121} __packed;
122 122
123struct vis_packet { 123struct vis_packet {
124 uint8_t packet_type; 124 uint8_t packet_type;
@@ -131,6 +131,6 @@ struct vis_packet {
131 * neighbors */ 131 * neighbors */
132 uint8_t target_orig[6]; /* who should receive this packet */ 132 uint8_t target_orig[6]; /* who should receive this packet */
133 uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */ 133 uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */
134} __attribute__((packed)); 134} __packed;
135 135
136#endif /* _NET_BATMAN_ADV_PACKET_H_ */ 136#endif /* _NET_BATMAN_ADV_PACKET_H_ */
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 97cb23dd3e69..bf3f6f5a12c4 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -246,13 +246,13 @@ struct vis_info {
246 /* this packet might be part of the vis send queue. */ 246 /* this packet might be part of the vis send queue. */
247 struct sk_buff *skb_packet; 247 struct sk_buff *skb_packet;
248 /* vis_info may follow here*/ 248 /* vis_info may follow here*/
249} __attribute__((packed)); 249} __packed;
250 250
251struct vis_info_entry { 251struct vis_info_entry {
252 uint8_t src[ETH_ALEN]; 252 uint8_t src[ETH_ALEN];
253 uint8_t dest[ETH_ALEN]; 253 uint8_t dest[ETH_ALEN];
254 uint8_t quality; /* quality = 0 means HNA */ 254 uint8_t quality; /* quality = 0 means HNA */
255} __attribute__((packed)); 255} __packed;
256 256
257struct recvlist_node { 257struct recvlist_node {
258 struct list_head list; 258 struct list_head list;