[v4,4/6] batman-adv: remove packed from batadv_ogm_packet

Message ID 1366879046-24507-5-git-send-email-siwu@hrz.tu-chemnitz.de (mailing list archive)
State Accepted, archived
Headers

Commit Message

Simon Wunderlich April 25, 2013, 8:37 a.m. UTC
  As we decreased the struct size from 26 to 24 byte, we can remove
__packed as the compiler will not add any more padding.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
---
 packet.h |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

Marek Lindner April 27, 2013, 5:47 a.m. UTC | #1
On Thursday, April 25, 2013 16:37:24 Simon Wunderlich wrote:
> As we decreased the struct size from 26 to 24 byte, we can remove
> __packed as the compiler will not add any more padding.
> 
> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
> ---
>  packet.h |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Applied in revision 85cc6b9.

Thanks,
Marek
  

Patch

diff --git a/packet.h b/packet.h
index 6d3b943..6982d16 100644
--- a/packet.h
+++ b/packet.h
@@ -178,7 +178,10 @@  struct batadv_ogm_packet {
 	uint8_t  reserved;
 	uint8_t  tq;
 	__be16   tvlv_len;
-} __packed;
+	/* __packed is not needed as the struct size is divisible by 4,
+	 * and the largest data type in this struct has a size of 4.
+	 */
+};
 
 #define BATADV_OGM_HLEN sizeof(struct batadv_ogm_packet)