diff options
| author | Jakub Kicinski <[email protected]> | 2025-07-23 17:10:44 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2025-07-25 00:28:49 +0000 |
| commit | 2c222dde61c4fcb8693d31acf5ef8e342fda4c26 (patch) | |
| tree | 166033f2c910828189f62b28f1eeedda6c46be42 /net/core/dev_api.c | |
| parent | tools: ynl-gen: move free printing to the print_type_full() helper (diff) | |
| download | kernel-2c222dde61c4fcb8693d31acf5ef8e342fda4c26.tar.gz kernel-2c222dde61c4fcb8693d31acf5ef8e342fda4c26.zip | |
tools: ynl-gen: print alloc helper for multi-val attrs
In general YNL provides allocation and free helpers for types.
For pure nested structs which are used as multi-attr (and therefore
have to be allocated dynamically) we already print a free helper
as it's needed by free of the containing struct.
Add printing of the alloc helper for consistency. The helper
takes the number of entries to allocate as an argument, e.g.:
static inline struct netdev_queue_id *netdev_queue_id_alloc(unsigned int n)
{
return calloc(n, sizeof(struct netdev_queue_id));
}
Reviewed-by: Donald Hunter <[email protected]>
Acked-by: Stanislav Fomichev <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/core/dev_api.c')
0 files changed, 0 insertions, 0 deletions
