From f0c98527a4dcf4eb42e538af22688f683823cb8e Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 29 Mar 2019 09:55:54 +0100 Subject: [PATCH] net: buf: Remove wrong alignment annotation from NET_BUF_SIMPLE() The code (net_buf_simple_init in particular) expects the data buffer to immediately follow the net_buf_simple struct, so it's wrong to request any specific alignment for this buffer. In practice this doesn't make any difference since the net_buf_simple struct itself is 4-bytes aligned and a multiple of 4 bytes, however the extra __net_buf_align makes it look like its location in memory doesn't need to immediately follow the net_buf_simple struct. Signed-off-by: Johan Hedberg --- include/net/buf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/buf.h b/include/net/buf.h index 7d12ed711abb38..a477a805b7554d 100644 --- a/include/net/buf.h +++ b/include/net/buf.h @@ -115,7 +115,7 @@ struct net_buf_simple { #define NET_BUF_SIMPLE(_size) \ ((struct net_buf_simple *)(&(struct { \ struct net_buf_simple buf; \ - u8_t data[_size] __net_buf_align; \ + u8_t data[_size]; \ }) { \ .buf.size = _size, \ }))