diff --git a/include/net/buf.h b/include/net/buf.h index 387b516195b..5eb6163fe71 100644 --- a/include/net/buf.h +++ b/include/net/buf.h @@ -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 { diff --git a/tests/net/buf/src/main.c b/tests/net/buf/src/main.c index 03d4a8b841d..274b4403224 100644 --- a/tests/net/buf/src/main.c +++ b/tests/net/buf/src/main.c @@ -63,7 +63,7 @@ static void buf_destroy(struct net_buf *buf); static void fixed_destroy(struct net_buf *buf); static void var_destroy(struct net_buf *buf); -NET_BUF_POOL_HEAP_DEFINE(bufs_pool, 10, buf_destroy); +NET_BUF_POOL_HEAP_DEFINE(bufs_pool, 10, 0, buf_destroy); NET_BUF_POOL_FIXED_DEFINE(fixed_pool, 10, 128, fixed_destroy); NET_BUF_POOL_VAR_DEFINE(var_pool, 10, 1024, 0, var_destroy);