diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2023-09-24 11:03:07 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2023-10-03 12:39:34 +0300 |
commit | ef35bed6fad6eda8de0277eda77803c748f306d1 (patch) | |
tree | 346df9dd64a714fc0cd62f45585cc0b7e9ffc85a /tools/perf/scripts/python/export-to-sqlite.py | |
parent | 13efc44ca644257dd35c1b380294086505e69e7e (diff) | |
download | linux-ef35bed6fad6eda8de0277eda77803c748f306d1.tar.xz |
udp_tunnel: Use flex array to simplify code
'n_tables' is small, UDP_TUNNEL_NIC_MAX_TABLES = 4 as a maximum. So there
is no real point to allocate the 'entries' pointers array with a dedicate
memory allocation.
Using a flexible array for struct udp_tunnel_nic->entries avoids the
overhead of an additional memory allocation.
This also saves an indirection when the array is accessed.
Finally, __counted_by() can be used for run-time bounds checking if
configured and supported by the compiler.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/4a096ba9cf981a588aa87235bb91e933ee162b3d.1695542544.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions