Documentation-getdelays: Apply a recommendation from "checkpatch.pl" in main()
authorMarkus Elfring <elfring@users.sourceforge.net>
Thu, 24 Dec 2015 10:05:32 +0000 (11:05 +0100)
committerJonathan Corbet <corbet@lwn.net>
Thu, 24 Dec 2015 14:22:32 +0000 (07:22 -0700)
The script "checkpatch.pl" pointed out that assignments should usually
not be performed within condition checks.
Thus move the assignment for the variable "nl_sd" to a separate statement.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/accounting/getdelays.c

index f40578026a04519e5e5a34ec613b36131c343444..7785fb5eb93f594af7518ceee2714bdf6681bbbb 100644 (file)
@@ -375,7 +375,8 @@ int main(int argc, char *argv[])
                }
        }
 
-       if ((nl_sd = create_nl_socket(NETLINK_GENERIC)) < 0)
+       nl_sd = create_nl_socket(NETLINK_GENERIC);
+       if (nl_sd < 0)
                err(1, "error creating Netlink socket\n");