]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Remove unneded {}s
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 12 Apr 2020 16:26:05 +0000 (18:26 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 13 Apr 2020 07:31:49 +0000 (09:31 +0200)
$ perl -i -0pe 's|\s+{\n([^\n]*;)\n\s+}\n|\n\1\n|gms' **/*.c

Inspired by ea7cbf5bdd68d7861ebf1570c439e8bbabd83f6c.

src/boot/efi/measure.c
src/core/transaction.c
src/home/homectl.c
src/import/curl-util.c
src/journal/test-catalog.c
src/locale/keymap-util.c
src/test/test-strv.c
src/udev/ata_id/ata_id.c
src/udev/scsi_id/scsi_id.c
src/udev/udev-builtin-input_id.c
src/update-utmp/update-utmp.c

index 768cb51d09e3a09ce532c1f0073d3d7b4efbd1c6..0b712d856f00fa83cd3c848be44597df775ec360 100644 (file)
@@ -302,9 +302,8 @@ EFI_STATUS tpm_log_event(UINT32 pcrindex, const EFI_PHYSICAL_ADDRESS buffer, UIN
         EFI_TCG2 *tpm2;
 
         tpm2 = tcg2_interface_check();
-        if (tpm2) {
+        if (tpm2)
                 return tpm2_measure_to_pcr_and_event_log(tpm2, pcrindex, buffer, buffer_size, description);
-        }
 
         tpm1 = tcg1_interface_check();
         if (tpm1)
index 49f43e03278c39d4e31a2b07616262330af1ca93..6f614a32dcf78363e707fe522713a7b8744729c8 100644 (file)
@@ -336,9 +336,8 @@ static char* merge_unit_ids(const char* unit_log_field, char **pairs) {
 
         STRV_FOREACH_PAIR(unit_id, job_type, pairs) {
                 next = strlen(unit_log_field) + strlen(*unit_id);
-                if (!GREEDY_REALLOC(ans, alloc, size + next + 1)) {
+                if (!GREEDY_REALLOC(ans, alloc, size + next + 1))
                         return mfree(ans);
-                }
 
                 sprintf(ans + size, "%s%s", unit_log_field, *unit_id);
                 if (*(unit_id+1))
index c8ddb2751f8ed737979b4af613c0692b6cdf8be5..91121687c683eda2d644daf0f25137a3c9ebedf8 100644 (file)
@@ -535,9 +535,8 @@ static int inspect_home(int argc, char *argv[], void *userdata) {
                         }
 
                         r = bus_call_method(bus, &home_mgr, "GetUserRecordByName", &error, &reply, "s", *i);
-                } else {
+                } else
                         r = bus_call_method(bus, &home_mgr, "GetUserRecordByUID", &error, &reply, "u", (uint32_t) uid);
-                }
 
                 if (r < 0) {
                         log_error_errno(r, "Failed to inspect home: %s", bus_error_message(&error, r));
index 5f21033db5a04ab01aef226175528cef7219819b..261fbece7159640030bdb7c422adeffb498cffd6 100644 (file)
@@ -166,9 +166,8 @@ CurlGlue *curl_glue_unref(CurlGlue *g) {
         if (g->curl)
                 curl_multi_cleanup(g->curl);
 
-        while ((io = hashmap_steal_first(g->ios))) {
+        while ((io = hashmap_steal_first(g->ios)))
                 sd_event_source_unref(io);
-        }
 
         hashmap_free(g->ios);
 
index ba14d922e26493e1f9506a1fc76fc7b80ef78298..158847f3eae642b799e2ae9d8d8d5536784efb4e 100644 (file)
@@ -116,9 +116,8 @@ static void test_catalog_import_merge(void) {
         h = test_import(input, -1, 0);
         assert_se(ordered_hashmap_size(h) == 1);
 
-        ORDERED_HASHMAP_FOREACH(payload, h, j) {
+        ORDERED_HASHMAP_FOREACH(payload, h, j)
                 assert_se(streq(combined, payload));
-        }
 }
 
 static void test_catalog_import_merge_no_body(void) {
@@ -149,9 +148,8 @@ static void test_catalog_import_merge_no_body(void) {
         h = test_import(input, -1, 0);
         assert_se(ordered_hashmap_size(h) == 1);
 
-        ORDERED_HASHMAP_FOREACH(payload, h, j) {
+        ORDERED_HASHMAP_FOREACH(payload, h, j)
                 assert_se(streq(combined, payload));
-        }
 }
 
 static void test_catalog_update(const char *database) {
index 30669a9359e58104898dcc1e9c460db27fee9562..233d0813002d8e6cbe071a05f182b628d555b20f 100644 (file)
@@ -267,9 +267,8 @@ int x11_read_data(Context *c, sd_bus_message *m) {
                                 else if (streq(a[1], "XkbOptions"))
                                         p = &c->x11_options;
 
-                                if (p) {
+                                if (p)
                                         free_and_replace(*p, a[2]);
-                                }
                         }
 
                 } else if (!in_section && first_word(l, "Section")) {
index 5473e983bd843ad11c2880cf614e51837ad331a6..ae128dd7e5968cc36cd4802b528cae3bf4ed499b 100644 (file)
@@ -408,9 +408,8 @@ static void test_strv_split_newlines(void) {
         l = strv_split_newlines(str);
         assert_se(l);
 
-        STRV_FOREACH(s, l) {
+        STRV_FOREACH(s, l)
                 assert_se(streq(*s, input_table_multiple[i++]));
-        }
 }
 
 static void test_strv_split_nulstr(void) {
index 57389372ce271f9e0c39fe986769f4e239a118ea..b5e14922a25dd8b799d0627ae96bcc71bf9336d1 100644 (file)
@@ -514,9 +514,8 @@ int main(int argc, char *argv[]) {
                                 printf("ID_TYPE=generic\n");
                                 break;
                         }
-                } else {
+                } else
                         printf("ID_TYPE=disk\n");
-                }
                 printf("ID_BUS=ata\n");
                 printf("ID_MODEL=%s\n", model);
                 printf("ID_MODEL_ENC=%s\n", model_enc);
@@ -524,9 +523,8 @@ int main(int argc, char *argv[]) {
                 if (serial[0] != '\0') {
                         printf("ID_SERIAL=%s_%s\n", model, serial);
                         printf("ID_SERIAL_SHORT=%s\n", serial);
-                } else {
+                } else
                         printf("ID_SERIAL=%s\n", model);
-                }
 
                 if (id.command_set_1 & (1<<5)) {
                         printf("ID_ATA_WRITE_CACHE=1\n");
index 94c3b232e5e408e3dae2eef76d16c370400dda35..bb08da28b52273fbe1ddcc80a51c3f5e8a4bd3cd 100644 (file)
@@ -111,9 +111,8 @@ static char *get_value(char **buffer) {
                  */
                 (*buffer)++;
                 end = quote_string;
-        } else {
+        } else
                 end = comma_string;
-        }
         val = strsep(buffer, end);
         if (val && end == quote_string)
                 /*
index 9ff2b02289892d408f514265c1d66a0f35ec19c4..215287c114cb0050f884246324edba6bd85389ce 100644 (file)
@@ -228,9 +228,8 @@ static bool test_pointers(sd_device *dev,
                         is_touchscreen = true;
                 else if (has_joystick_axes_or_buttons)
                         is_joystick = true;
-        } else if (has_joystick_axes_or_buttons) {
+        } else if (has_joystick_axes_or_buttons)
                 is_joystick = true;
-        }
 
         if (has_mt_coordinates) {
                 if (stylus_or_pen)
index 55fd8ba46e4c1a530ace772e6c4f44047b0b7c92..fd24cdc789a9cb4aa97237b5bdf21008b3a0d143 100644 (file)
@@ -125,9 +125,8 @@ static int on_reboot(Context *c) {
 #if HAVE_AUDIT
         if (c->audit_fd >= 0)
                 if (audit_log_user_comm_message(c->audit_fd, AUDIT_SYSTEM_BOOT, "", "systemd-update-utmp", NULL, NULL, NULL, 1) < 0 &&
-                    errno != EPERM) {
+                    errno != EPERM)
                         r = log_error_errno(errno, "Failed to send audit message: %m");
-                }
 #endif
 
         /* If this call fails it will return 0, which
@@ -154,9 +153,8 @@ static int on_shutdown(Context *c) {
 #if HAVE_AUDIT
         if (c->audit_fd >= 0)
                 if (audit_log_user_comm_message(c->audit_fd, AUDIT_SYSTEM_SHUTDOWN, "", "systemd-update-utmp", NULL, NULL, NULL, 1) < 0 &&
-                    errno != EPERM) {
+                    errno != EPERM)
                         r = log_error_errno(errno, "Failed to send audit message: %m");
-                }
 #endif
 
         q = utmp_put_shutdown();