From 0015ada629a70be0139ee9a0e4d3fb6512f90f56 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 7 Jul 2021 07:39:07 -0700 Subject: [PATCH] libnetlink: cosmetic changes Don't initialize arguments that are NULL, and format initialization in a more logical way. Signed-off-by: Stephen Hemminger --- lib/libnetlink.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/libnetlink.c b/lib/libnetlink.c index b92f10e1..5f062c7d 100644 --- a/lib/libnetlink.c +++ b/lib/libnetlink.c @@ -943,12 +943,14 @@ skip_it: } int rtnl_dump_filter_nc(struct rtnl_handle *rth, - rtnl_filter_t filter, - void *arg1, __u16 nc_flags) + rtnl_filter_t filter, + void *arg1, __u16 nc_flags) { - const struct rtnl_dump_filter_arg a[2] = { - { .filter = filter, .arg1 = arg1, - .errhndlr = NULL, .arg2 = NULL, .nc_flags = nc_flags, }, + const struct rtnl_dump_filter_arg a[] = { + { + .filter = filter, .arg1 = arg1, + .nc_flags = nc_flags, + }, { }, }; @@ -962,9 +964,12 @@ int rtnl_dump_filter_errhndlr_nc(struct rtnl_handle *rth, void *arg2, __u16 nc_flags) { - const struct rtnl_dump_filter_arg a[2] = { - { .filter = filter, .arg1 = arg1, - .errhndlr = errhndlr, .arg2 = arg2, .nc_flags = nc_flags, }, + const struct rtnl_dump_filter_arg a[] = { + { + .filter = filter, .arg1 = arg1, + .errhndlr = errhndlr, .arg2 = arg2, + .nc_flags = nc_flags, + }, { }, };