chiark / gitweb /
udev: place opening { at the same line as the function declaration
[elogind.git] / src / udev / udevadm.c
index 5e69e192c03bd75d1e8e2ebe3b63d98e5846ece8..1c06c1aacdaefabb0a88426161135b6a9d7e8b97 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2012 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2007-2012 Kay Sievers <kay@vrfy.org>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 void udev_main_log(struct udev *udev, int priority,
                    const char *file, int line, const char *fn,
-                   const char *format, va_list args)
-{
+                   const char *format, va_list args) {
         log_metav(priority, file, line, fn, format, args);
 }
 
-static int adm_version(struct udev *udev, int argc, char *argv[])
-{
+static int adm_version(struct udev *udev, int argc, char *argv[]) {
         printf("%s\n", VERSION);
         return 0;
 }
@@ -63,8 +61,7 @@ static const struct udevadm_cmd *udevadm_cmds[] = {
         &udevadm_help,
 };
 
-static int adm_help(struct udev *udev, int argc, char *argv[])
-{
+static int adm_help(struct udev *udev, int argc, char *argv[]) {
         unsigned int i;
 
         fprintf(stderr, "Usage: udevadm [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS]\n");
@@ -75,16 +72,14 @@ static int adm_help(struct udev *udev, int argc, char *argv[])
         return 0;
 }
 
-static int run_command(struct udev *udev, const struct udevadm_cmd *cmd, int argc, char *argv[])
-{
+static int run_command(struct udev *udev, const struct udevadm_cmd *cmd, int argc, char *argv[]) {
         if (cmd->debug)
                 log_set_max_level(LOG_DEBUG);
-        log_debug("calling: %s\n", cmd->name);
+        log_debug("calling: %s", cmd->name);
         return cmd->cmd(udev, argc, argv);
 }
 
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
         struct udev *udev;
         static const struct option options[] = {
                 { "debug", no_argument, NULL, 'd' },
@@ -131,7 +126,7 @@ int main(int argc, char *argv[])
 
         if (command != NULL)
                 for (i = 0; i < ELEMENTSOF(udevadm_cmds); i++) {
-                        if (strcmp(udevadm_cmds[i]->name, command) == 0) {
+                        if (streq(udevadm_cmds[i]->name, command)) {
                                 argc -= optind;
                                 argv += optind;
                                 /* we need '0' here to reset the internal state */