Thread (55 messages) 55 messages, 6 authors, 2025-09-11

Re: [PATCH net-next 05/11] tools: ynl-gen: define nlattr *array in a block scope

From: Donald Hunter <donald.hunter@gmail.com>
Date: 2025-09-05 10:54:03
Also in: lkml

Asbjørn Sloth Tønnesen [off-list ref] writes:
Instead of trying to define "struct nlattr *array;" in the all
the right places, then simply define it in a block scope,
as it's only used here.

Before this patch it was generated for attribute set _put()
functions, like wireguard_wgpeer_put(), but missing and caused a
compile error for the command function wireguard_set_device().

$ make -C tools/net/ynl/generated wireguard-user.o
-e      CC wireguard-user.o
wireguard-user.c: In function ‘wireguard_set_device’:
wireguard-user.c:548:9: error: ‘array’ undeclared (first use in ..)
  548 |         array = ynl_attr_nest_start(nlh, WGDEVICE_A_PEERS);
      |         ^~~~~

Signed-off-by: Asbjørn Sloth Tønnesen <redacted>
Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help