From 1d7b63d0fed82a497bc810f9f6b4eb3f113b1eb0 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Wed, 24 Nov 2021 21:07:40 +1000 Subject: [PATCH] net: buf: `STRUCT_SECTION_ITERABLE` for pool decl Use the `STRUCT_SECTION_ITERABLE` helper macro when declaring buffer pools instead of manually doing the same thing. Signed-off-by: Jordan Yates --- include/net/buf.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/include/net/buf.h b/include/net/buf.h index 62718e980de..6bab31e4d67 100644 --- a/include/net/buf.h +++ b/include/net/buf.h @@ -1089,8 +1089,7 @@ extern const struct net_buf_data_alloc net_buf_heap_alloc; */ #define NET_BUF_POOL_HEAP_DEFINE(_name, _count, _ud_size, _destroy) \ _NET_BUF_ARRAY_DEFINE(_name, _count, _ud_size); \ - static struct net_buf_pool _name __net_buf_align \ - __in_section(_net_buf_pool, static, _name) = \ + static STRUCT_SECTION_ITERABLE(net_buf_pool, _name) = \ NET_BUF_POOL_INITIALIZER(_name, &net_buf_heap_alloc, \ _net_buf_##_name, _count, _ud_size, \ _destroy) @@ -1143,8 +1142,7 @@ extern const struct net_buf_data_cb net_buf_fixed_cb; .cb = &net_buf_fixed_cb, \ .alloc_data = (void *)&net_buf_fixed_##_name, \ }; \ - static struct net_buf_pool _name __net_buf_align \ - __in_section(_net_buf_pool, static, _name) = \ + static STRUCT_SECTION_ITERABLE(net_buf_pool, _name) = \ NET_BUF_POOL_INITIALIZER(_name, &net_buf_fixed_alloc_##_name, \ _net_buf_##_name, _count, _ud_size, \ _destroy) @@ -1184,8 +1182,7 @@ extern const struct net_buf_data_cb net_buf_var_cb; .cb = &net_buf_var_cb, \ .alloc_data = &net_buf_mem_pool_##_name, \ }; \ - static struct net_buf_pool _name __net_buf_align \ - __in_section(_net_buf_pool, static, _name) = \ + static STRUCT_SECTION_ITERABLE(net_buf_pool, _name) = \ NET_BUF_POOL_INITIALIZER(_name, &net_buf_data_alloc_##_name, \ _net_buf_##_name, _count, _ud_size, \ _destroy)