libnetlink: cosmetic changes

Don't initialize arguments that are NULL, and format initialization
in a more logical way.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Stephen Hemminger 2021-07-07 07:39:07 -07:00
parent 459ce6e3d7
commit 0015ada629
1 changed files with 13 additions and 8 deletions

View File

@ -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,
},
{ },
};