X Tutup
Skip to content

Commit 38cd55b

Browse files
keszybzpoettering
authored andcommitted
Remove unneded {}s
$ perl -i -0pe 's|\s+{\n([^\n]*;)\n\s+}\n|\n\1\n|gms' **/*.c Inspired by ea7cbf5.
1 parent 8cf85bb commit 38cd55b

File tree

11 files changed

+14
-28
lines changed

11 files changed

+14
-28
lines changed

src/boot/efi/measure.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,8 @@ EFI_STATUS tpm_log_event(UINT32 pcrindex, const EFI_PHYSICAL_ADDRESS buffer, UIN
302302
EFI_TCG2 *tpm2;
303303

304304
tpm2 = tcg2_interface_check();
305-
if (tpm2) {
305+
if (tpm2)
306306
return tpm2_measure_to_pcr_and_event_log(tpm2, pcrindex, buffer, buffer_size, description);
307-
}
308307

309308
tpm1 = tcg1_interface_check();
310309
if (tpm1)

src/core/transaction.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,8 @@ static char* merge_unit_ids(const char* unit_log_field, char **pairs) {
336336

337337
STRV_FOREACH_PAIR(unit_id, job_type, pairs) {
338338
next = strlen(unit_log_field) + strlen(*unit_id);
339-
if (!GREEDY_REALLOC(ans, alloc, size + next + 1)) {
339+
if (!GREEDY_REALLOC(ans, alloc, size + next + 1))
340340
return mfree(ans);
341-
}
342341

343342
sprintf(ans + size, "%s%s", unit_log_field, *unit_id);
344343
if (*(unit_id+1))

src/home/homectl.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,8 @@ static int inspect_home(int argc, char *argv[], void *userdata) {
535535
}
536536

537537
r = bus_call_method(bus, &home_mgr, "GetUserRecordByName", &error, &reply, "s", *i);
538-
} else {
538+
} else
539539
r = bus_call_method(bus, &home_mgr, "GetUserRecordByUID", &error, &reply, "u", (uint32_t) uid);
540-
}
541540

542541
if (r < 0) {
543542
log_error_errno(r, "Failed to inspect home: %s", bus_error_message(&error, r));

src/import/curl-util.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,8 @@ CurlGlue *curl_glue_unref(CurlGlue *g) {
166166
if (g->curl)
167167
curl_multi_cleanup(g->curl);
168168

169-
while ((io = hashmap_steal_first(g->ios))) {
169+
while ((io = hashmap_steal_first(g->ios)))
170170
sd_event_source_unref(io);
171-
}
172171

173172
hashmap_free(g->ios);
174173

src/journal/test-catalog.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@ static void test_catalog_import_merge(void) {
116116
h = test_import(input, -1, 0);
117117
assert_se(ordered_hashmap_size(h) == 1);
118118

119-
ORDERED_HASHMAP_FOREACH(payload, h, j) {
119+
ORDERED_HASHMAP_FOREACH(payload, h, j)
120120
assert_se(streq(combined, payload));
121-
}
122121
}
123122

124123
static void test_catalog_import_merge_no_body(void) {
@@ -149,9 +148,8 @@ static void test_catalog_import_merge_no_body(void) {
149148
h = test_import(input, -1, 0);
150149
assert_se(ordered_hashmap_size(h) == 1);
151150

152-
ORDERED_HASHMAP_FOREACH(payload, h, j) {
151+
ORDERED_HASHMAP_FOREACH(payload, h, j)
153152
assert_se(streq(combined, payload));
154-
}
155153
}
156154

157155
static void test_catalog_update(const char *database) {

src/locale/keymap-util.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,8 @@ int x11_read_data(Context *c, sd_bus_message *m) {
267267
else if (streq(a[1], "XkbOptions"))
268268
p = &c->x11_options;
269269

270-
if (p) {
270+
if (p)
271271
free_and_replace(*p, a[2]);
272-
}
273272
}
274273

275274
} else if (!in_section && first_word(l, "Section")) {

src/test/test-strv.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,8 @@ static void test_strv_split_newlines(void) {
408408
l = strv_split_newlines(str);
409409
assert_se(l);
410410

411-
STRV_FOREACH(s, l) {
411+
STRV_FOREACH(s, l)
412412
assert_se(streq(*s, input_table_multiple[i++]));
413-
}
414413
}
415414

416415
static void test_strv_split_nulstr(void) {

src/udev/ata_id/ata_id.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,19 +514,17 @@ int main(int argc, char *argv[]) {
514514
printf("ID_TYPE=generic\n");
515515
break;
516516
}
517-
} else {
517+
} else
518518
printf("ID_TYPE=disk\n");
519-
}
520519
printf("ID_BUS=ata\n");
521520
printf("ID_MODEL=%s\n", model);
522521
printf("ID_MODEL_ENC=%s\n", model_enc);
523522
printf("ID_REVISION=%s\n", revision);
524523
if (serial[0] != '\0') {
525524
printf("ID_SERIAL=%s_%s\n", model, serial);
526525
printf("ID_SERIAL_SHORT=%s\n", serial);
527-
} else {
526+
} else
528527
printf("ID_SERIAL=%s\n", model);
529-
}
530528

531529
if (id.command_set_1 & (1<<5)) {
532530
printf("ID_ATA_WRITE_CACHE=1\n");

src/udev/scsi_id/scsi_id.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,8 @@ static char *get_value(char **buffer) {
111111
*/
112112
(*buffer)++;
113113
end = quote_string;
114-
} else {
114+
} else
115115
end = comma_string;
116-
}
117116
val = strsep(buffer, end);
118117
if (val && end == quote_string)
119118
/*

src/udev/udev-builtin-input_id.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,8 @@ static bool test_pointers(sd_device *dev,
228228
is_touchscreen = true;
229229
else if (has_joystick_axes_or_buttons)
230230
is_joystick = true;
231-
} else if (has_joystick_axes_or_buttons) {
231+
} else if (has_joystick_axes_or_buttons)
232232
is_joystick = true;
233-
}
234233

235234
if (has_mt_coordinates) {
236235
if (stylus_or_pen)

0 commit comments

Comments
 (0)
X Tutup