chiark / gitweb /
completion: filter templates from restartable units
[elogind.git] / src / udev / udev-builtin-firmware.c
index b80940b6efde9bed416f26d1135e952e94c0ccd8..bd8c2fb966c8d259026cb802e04f70ba7f15fa90 100644 (file)
 
 #include "udev.h"
 
 
 #include "udev.h"
 
-static bool set_loading(struct udev *udev, char *loadpath, const char *state)
-{
+static bool set_loading(struct udev *udev, char *loadpath, const char *state) {
         FILE *ldfile;
 
         ldfile = fopen(loadpath, "we");
         if (ldfile == NULL) {
         FILE *ldfile;
 
         ldfile = fopen(loadpath, "we");
         if (ldfile == NULL) {
-                log_error("error: can not open '%s'\n", loadpath);
+                log_error("error: can not open '%s'", loadpath);
                 return false;
         };
         fprintf(ldfile, "%s\n", state);
                 return false;
         };
         fprintf(ldfile, "%s\n", state);
@@ -41,8 +40,7 @@ static bool set_loading(struct udev *udev, char *loadpath, const char *state)
         return true;
 }
 
         return true;
 }
 
-static bool copy_firmware(struct udev *udev, const char *source, const char *target, size_t size)
-{
+static bool copy_firmware(struct udev *udev, const char *source, const char *target, size_t size) {
         char *buf;
         FILE *fsource = NULL, *ftarget = NULL;
         bool ret = false;
         char *buf;
         FILE *fsource = NULL, *ftarget = NULL;
         bool ret = false;
@@ -53,7 +51,7 @@ static bool copy_firmware(struct udev *udev, const char *source, const char *tar
                 return false;
         }
 
                 return false;
         }
 
-        log_debug("writing '%s' (%zi) to '%s'\n", source, size, target);
+        log_debug("writing '%s' (%zi) to '%s'", source, size, target);
 
         fsource = fopen(source, "re");
         if (fsource == NULL)
 
         fsource = fopen(source, "re");
         if (fsource == NULL)
@@ -74,8 +72,7 @@ exit:
         return ret;
 }
 
         return ret;
 }
 
-static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], bool test)
-{
+static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], bool test) {
         struct udev *udev = udev_device_get_udev(dev);
         static const char *searchpath[] = { FIRMWARE_PATH };
         char loadpath[UTIL_PATH_SIZE];
         struct udev *udev = udev_device_get_udev(dev);
         static const char *searchpath[] = { FIRMWARE_PATH };
         char loadpath[UTIL_PATH_SIZE];
@@ -90,7 +87,7 @@ static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], boo
 
         firmware = udev_device_get_property_value(dev, "FIRMWARE");
         if (firmware == NULL) {
 
         firmware = udev_device_get_property_value(dev, "FIRMWARE");
         if (firmware == NULL) {
-                log_error("firmware parameter missing\n\n");
+                log_error("firmware parameter missing");
                 rc = EXIT_FAILURE;
                 goto exit;
         }
                 rc = EXIT_FAILURE;
                 goto exit;
         }
@@ -112,7 +109,7 @@ static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], boo
         strscpyl(loadpath, sizeof(loadpath), udev_device_get_syspath(dev), "/loading", NULL);
 
         if (fwfile == NULL) {
         strscpyl(loadpath, sizeof(loadpath), udev_device_get_syspath(dev), "/loading", NULL);
 
         if (fwfile == NULL) {
-                log_debug("did not find firmware file '%s'\n", firmware);
+                log_debug("did not find firmware file '%s'", firmware);
                 rc = EXIT_FAILURE;
                 /*
                  * Do not cancel the request in the initrd, the real root might have
                 rc = EXIT_FAILURE;
                 /*
                  * Do not cancel the request in the initrd, the real root might have
@@ -136,7 +133,7 @@ static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], boo
 
         strscpyl(datapath, sizeof(datapath), udev_device_get_syspath(dev), "/data", NULL);
         if (!copy_firmware(udev, fwpath, datapath, statbuf.st_size)) {
 
         strscpyl(datapath, sizeof(datapath), udev_device_get_syspath(dev), "/data", NULL);
         if (!copy_firmware(udev, fwpath, datapath, statbuf.st_size)) {
-                log_error("error sending firmware '%s' to device\n", firmware);
+                log_error("error sending firmware '%s' to device", firmware);
                 set_loading(udev, loadpath, "-1");
                 rc = EXIT_FAILURE;
                 goto exit;
                 set_loading(udev, loadpath, "-1");
                 rc = EXIT_FAILURE;
                 goto exit;