diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-04-12 18:26:05 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-04-13 09:31:49 +0200 |
commit | 38cd55b007c955ee1a5fd80d89086d4f930d802d (patch) | |
tree | ff14a30ae6d0994dbca76139ff3f74aeaf47b1cc | |
parent | 8cf85bb5750766cf0cff53b0b73be5a5a39279f5 (diff) | |
download | systemd-38cd55b007c955ee1a5fd80d89086d4f930d802d.tar.gz |
Remove unneded {}s
$ perl -i -0pe 's|\s+{\n([^\n]*;)\n\s+}\n|\n\1\n|gms' **/*.c
Inspired by ea7cbf5bdd68d7861ebf1570c439e8bbabd83f6c.
-rw-r--r-- | src/boot/efi/measure.c | 3 | ||||
-rw-r--r-- | src/core/transaction.c | 3 | ||||
-rw-r--r-- | src/home/homectl.c | 3 | ||||
-rw-r--r-- | src/import/curl-util.c | 3 | ||||
-rw-r--r-- | src/journal/test-catalog.c | 6 | ||||
-rw-r--r-- | src/locale/keymap-util.c | 3 | ||||
-rw-r--r-- | src/test/test-strv.c | 3 | ||||
-rw-r--r-- | src/udev/ata_id/ata_id.c | 6 | ||||
-rw-r--r-- | src/udev/scsi_id/scsi_id.c | 3 | ||||
-rw-r--r-- | src/udev/udev-builtin-input_id.c | 3 | ||||
-rw-r--r-- | src/update-utmp/update-utmp.c | 6 |
11 files changed, 14 insertions, 28 deletions
diff --git a/src/boot/efi/measure.c b/src/boot/efi/measure.c index 768cb51d09..0b712d856f 100644 --- a/src/boot/efi/measure.c +++ b/src/boot/efi/measure.c @@ -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) diff --git a/src/core/transaction.c b/src/core/transaction.c index 49f43e0327..6f614a32dc 100644 --- a/src/core/transaction.c +++ b/src/core/transaction.c @@ -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)) diff --git a/src/home/homectl.c b/src/home/homectl.c index c8ddb2751f..91121687c6 100644 --- a/src/home/homectl.c +++ b/src/home/homectl.c @@ -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)); diff --git a/src/import/curl-util.c b/src/import/curl-util.c index 5f21033db5..261fbece71 100644 --- a/src/import/curl-util.c +++ b/src/import/curl-util.c @@ -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); diff --git a/src/journal/test-catalog.c b/src/journal/test-catalog.c index ba14d922e2..158847f3ea 100644 --- a/src/journal/test-catalog.c +++ b/src/journal/test-catalog.c @@ -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) { diff --git a/src/locale/keymap-util.c b/src/locale/keymap-util.c index 30669a9359..233d081300 100644 --- a/src/locale/keymap-util.c +++ b/src/locale/keymap-util.c @@ -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")) { diff --git a/src/test/test-strv.c b/src/test/test-strv.c index 5473e983bd..ae128dd7e5 100644 --- a/src/test/test-strv.c +++ b/src/test/test-strv.c @@ -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) { diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c index 57389372ce..b5e14922a2 100644 --- a/src/udev/ata_id/ata_id.c +++ b/src/udev/ata_id/ata_id.c @@ -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"); diff --git a/src/udev/scsi_id/scsi_id.c b/src/udev/scsi_id/scsi_id.c index 94c3b232e5..bb08da28b5 100644 --- a/src/udev/scsi_id/scsi_id.c +++ b/src/udev/scsi_id/scsi_id.c @@ -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) /* diff --git a/src/udev/udev-builtin-input_id.c b/src/udev/udev-builtin-input_id.c index 9ff2b02289..215287c114 100644 --- a/src/udev/udev-builtin-input_id.c +++ b/src/udev/udev-builtin-input_id.c @@ -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) diff --git a/src/update-utmp/update-utmp.c b/src/update-utmp/update-utmp.c index 55fd8ba46e..fd24cdc789 100644 --- a/src/update-utmp/update-utmp.c +++ b/src/update-utmp/update-utmp.c @@ -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(); |