]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
libnetlink: cosmetic changes
authorStephen Hemminger <stephen@networkplumber.org>
Wed, 7 Jul 2021 14:39:07 +0000 (07:39 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 7 Jul 2021 14:39:07 +0000 (07:39 -0700)
Don't initialize arguments that are NULL, and format initialization
in a more logical way.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
lib/libnetlink.c

index b92f10e1194e39c8a97d26d052687d6de4b3d57b..5f062c7d5442b2a0a14dd38229373c255488073f 100644 (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)
-{
-       const struct rtnl_dump_filter_arg a[2] = {
-               { .filter = filter, .arg1 = arg1,
-                 .errhndlr = NULL, .arg2 = NULL, .nc_flags = nc_flags, },
+                       rtnl_filter_t filter,
+                       void *arg1, __u16 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,
+               },
                { },
        };