net: buf: POOL_HEAP_DEFINE explicit user data

Update the macro prototype to explicitly require the length of the
desired user data. Update all in-tree usage of this macro.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
This commit is contained in:
Jordan Yates 2021-11-21 12:09:05 +10:00 committed by Johan Hedberg
commit d17e0439c2
2 changed files with 8 additions and 8 deletions

View file

@ -1088,15 +1088,15 @@ extern const struct net_buf_data_alloc net_buf_heap_alloc;
*
* @param _name Name of the pool variable.
* @param _count Number of buffers in the pool.
* @param _ud_size User data space to reserve per buffer.
* @param _destroy Optional destroy callback when buffer is freed.
*/
#define NET_BUF_POOL_HEAP_DEFINE(_name, _count, _destroy) \
_NET_BUF_ARRAY_DEFINE(_name, _count, CONFIG_NET_BUF_USER_DATA_SIZE); \
static struct net_buf_pool _name __net_buf_align \
__in_section(_net_buf_pool, static, _name) = \
NET_BUF_POOL_INITIALIZER(_name, &net_buf_heap_alloc, \
_net_buf_##_name, _count, \
CONFIG_NET_BUF_USER_DATA_SIZE, \
#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) = \
NET_BUF_POOL_INITIALIZER(_name, &net_buf_heap_alloc, \
_net_buf_##_name, _count, _ud_size, \
_destroy)
struct net_buf_pool_fixed {