mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
tools: ynl: make yarg the first member of struct ynl_dump_state
All YNL parsing code expects a pointer to struct ynl_parse_arg AKA yarg. For dump was pass in struct ynl_dump_state, which works fine, because struct ynl_dump_state and struct ynl_parse_arg have identical layout for the members that matter.. but it's a bit hacky. Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Link: https://lore.kernel.org/r/20240227223032.1835527-7-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -864,7 +864,7 @@ static int ynl_dump_trampoline(const struct nlmsghdr *nlh, void *data)
|
||||
struct ynl_parse_arg yarg = {};
|
||||
int ret;
|
||||
|
||||
ret = ynl_check_alien(ds->ys, nlh, ds->rsp_cmd);
|
||||
ret = ynl_check_alien(ds->yarg.ys, nlh, ds->rsp_cmd);
|
||||
if (ret)
|
||||
return ret < 0 ? MNL_CB_ERROR : MNL_CB_OK;
|
||||
|
||||
@@ -878,8 +878,7 @@ static int ynl_dump_trampoline(const struct nlmsghdr *nlh, void *data)
|
||||
ds->last->next = obj;
|
||||
ds->last = obj;
|
||||
|
||||
yarg.ys = ds->ys;
|
||||
yarg.rsp_policy = ds->rsp_policy;
|
||||
yarg = ds->yarg;
|
||||
yarg.data = &obj->data;
|
||||
|
||||
return ds->cb(nlh, &yarg);
|
||||
|
||||
Reference in New Issue
Block a user