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 <jordan.yates@data61.csiro.au>
This commit is contained in:
parent
8e99db5801
commit
1d7b63d0fe
1 changed files with 3 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue