Skip to content

Commit f0c9852

Browse files
Johan Hedbergnashif
authored andcommitted
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 <[email protected]>
1 parent d9f5345 commit f0c9852

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/buf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ struct net_buf_simple {
115115
#define NET_BUF_SIMPLE(_size) \
116116
((struct net_buf_simple *)(&(struct { \
117117
struct net_buf_simple buf; \
118-
u8_t data[_size] __net_buf_align; \
118+
u8_t data[_size]; \
119119
}) { \
120120
.buf.size = _size, \
121121
}))

0 commit comments

Comments
 (0)