[PATCH net-next v3 07/13] tools: ynl-gen: avoid repetitive variables definitions

Donald Hunter donald.hunter at gmail.com
Fri Sep 12 12:08:53 UTC 2025


Asbjørn Sloth Tønnesen <ast at fiberby.net> writes:

> In the generated attribute parsing code, avoid repetitively
> defining the same variables over and over again, local to
> the conditional block for each attribute.
>
> This patch consolidates the definitions of local variables
> for attribute parsing, so that they are defined at the
> function level, and re-used across attributes, thus making
> the generated code read more natural.
>
> If attributes defines identical local_vars, then they will
> be deduplicated, attributes are assumed to only use their
> local variables transiently.
>
> ...
>
> Suggested-by: Jakub Kicinski <kuba at kernel.org>
> Signed-off-by: Asbjørn Sloth Tønnesen <ast at fiberby.net>

Reviewed-by: Donald Hunter <donald.hunter at gmail.com>


More information about the WireGuard mailing list