From b4764836396465521181a1d8d2817d078cec0864 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 23 Apr 2026 18:46:57 +0200 Subject: [PATCH] various: use empty block not break after OPTION_GROUP Use the same style everywhere. --- src/bootctl/bootctl.c | 6 ++---- src/imds/imdsd.c | 3 +-- src/sysusers/sysusers.c | 3 +-- src/test/test-options.c | 3 +-- src/tmpfiles/tmpfiles.c | 3 +-- src/vmspawn/vmspawn.c | 30 ++++++++++-------------------- 6 files changed, 16 insertions(+), 32 deletions(-) diff --git a/src/bootctl/bootctl.c b/src/bootctl/bootctl.c index 9ec25962853..59a93d07c3f 100644 --- a/src/bootctl/bootctl.c +++ b/src/bootctl/bootctl.c @@ -422,8 +422,7 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) { FOREACH_OPTION(&state, c, &arg, /* on_error= */ return c) switch (c) { - OPTION_GROUP("Block Device Discovery Commands"): - break; + OPTION_GROUP("Block Device Discovery Commands"): {} OPTION('p', "print-esp-path", NULL, "Print path to the EFI System Partition mount point"): {} OPTION_LONG("print-path", NULL, /* help= */ NULL): /* Compatibility alias */ @@ -455,8 +454,7 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) { arg_print_efi_architecture = true; break; - OPTION_GROUP("Options"): - break; + OPTION_GROUP("Options"): {} OPTION_COMMON_HELP: return help(); diff --git a/src/imds/imdsd.c b/src/imds/imdsd.c index 8ab34986566..b3d17711611 100644 --- a/src/imds/imdsd.c +++ b/src/imds/imdsd.c @@ -2348,8 +2348,7 @@ static int parse_argv(int argc, char *argv[]) { break; /* The following all configure endpoint information explicitly */ - OPTION_GROUP("Manual Endpoint Configuration"): - break; + OPTION_GROUP("Manual Endpoint Configuration"): {} OPTION_LONG("vendor", "VENDOR", "Specify IMDS vendor literally"): if (isempty(arg)) { diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c index 1f79e2face5..ff391cb3165 100644 --- a/src/sysusers/sysusers.c +++ b/src/sysusers/sysusers.c @@ -2121,8 +2121,7 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) { OPTION_COMMON_VERSION: return version(); - OPTION_GROUP("Options"): - break; + OPTION_GROUP("Options"): {} OPTION_LONG("root", "PATH", "Operate on an alternate filesystem root"): r = parse_path_argument(arg, /* suppress_root= */ false, &arg_root); diff --git a/src/test/test-options.c b/src/test/test-options.c index 687bafd4a2b..1c9073b7a56 100644 --- a/src/test/test-options.c +++ b/src/test/test-options.c @@ -811,8 +811,7 @@ static void test_macros_parse_one( break; /* OPTION_GROUP: group marker (never returned by parser) */ - OPTION_GROUP("Advanced"): - break; + OPTION_GROUP("Advanced"): {} /* OPTION_LONG: long only, in the "Advanced" group */ OPTION_LONG("debug", NULL, "Enable debug mode"): diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 9975ffca393..0c133b08c84 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -4225,8 +4225,7 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) { OPTION_COMMON_VERSION: return version(); - OPTION_GROUP("Options"): - break; + OPTION_GROUP("Options"): {} OPTION_LONG("user", NULL, "Execute user configuration"): arg_runtime_scope = RUNTIME_SCOPE_USER; diff --git a/src/vmspawn/vmspawn.c b/src/vmspawn/vmspawn.c index fa8c3402ffc..fef8353a2c8 100644 --- a/src/vmspawn/vmspawn.c +++ b/src/vmspawn/vmspawn.c @@ -359,8 +359,7 @@ static int parse_argv(int argc, char *argv[]) { arg_runtime_scope = RUNTIME_SCOPE_USER; break; - OPTION_GROUP("Image"): - break; + OPTION_GROUP("Image"): {} OPTION('D', "directory", "PATH", "Root directory for the VM"): r = parse_path_argument(arg, /* suppress_root= */ false, &arg_directory); @@ -393,8 +392,7 @@ static int parse_argv(int argc, char *argv[]) { "Invalid image disk type: %s", arg); break; - OPTION_GROUP("Host Configuration"): - break; + OPTION_GROUP("Host Configuration"): {} OPTION_LONG("cpus", "CPUS", "Configure number of CPUs in guest"): {} OPTION_LONG("qemu-smp", "CPUS", /* help= */ NULL): /* Compat alias */ @@ -655,8 +653,7 @@ static int parse_argv(int argc, char *argv[]) { return log_error_errno(r, "Failed to parse --grow-image= parameter: %s", arg); break; - OPTION_GROUP("Execution"): - break; + OPTION_GROUP("Execution"): {} OPTION('s', "smbios11", "STRING", "Pass an arbitrary SMBIOS Type #11 string to the VM"): if (isempty(arg)) { @@ -677,8 +674,7 @@ static int parse_argv(int argc, char *argv[]) { return r; break; - OPTION_GROUP("System Identity"): - break; + OPTION_GROUP("System Identity"): {} OPTION('M', "machine", "NAME", "Set the machine name for the VM"): if (isempty(arg)) @@ -702,8 +698,7 @@ static int parse_argv(int argc, char *argv[]) { return log_error_errno(r, "Invalid UUID: %s", arg); break; - OPTION_GROUP("Properties"): - break; + OPTION_GROUP("Properties"): {} OPTION('S', "slice", "SLICE", "Place the VM in the specified slice"): { _cleanup_free_ char *mangled = NULL; @@ -732,8 +727,7 @@ static int parse_argv(int argc, char *argv[]) { arg_keep_unit = true; break; - OPTION_GROUP("User Namespacing"): - break; + OPTION_GROUP("User Namespacing"): {} OPTION_LONG("private-users", "UIDBASE[:NUIDS]", "Configure the UID/GID range to map into the virtiofsd namespace"): @@ -742,8 +736,7 @@ static int parse_argv(int argc, char *argv[]) { return r; break; - OPTION_GROUP("Mounts"): - break; + OPTION_GROUP("Mounts"): {} OPTION_LONG("bind", "SOURCE[:TARGET]", "Mount a file or directory from the host into the VM"): {} OPTION_LONG("bind-ro", "SOURCE[:TARGET]", "Mount a file or directory, but read-only"): { @@ -835,8 +828,7 @@ static int parse_argv(int argc, char *argv[]) { return log_oom(); break; - OPTION_GROUP("Integration"): - break; + OPTION_GROUP("Integration"): {} OPTION_LONG("forward-journal", "FILE|DIR", "Forward the VM's journal to the host"): r = parse_path_argument(arg, /* suppress_root= */ false, &arg_forward_journal); @@ -864,8 +856,7 @@ static int parse_argv(int argc, char *argv[]) { return r; break; - OPTION_GROUP("Input/Output"): - break; + OPTION_GROUP("Input/Output"): {} OPTION_LONG("console", "MODE", "Console mode (interactive, native, gui, read-only or headless)"): @@ -890,8 +881,7 @@ static int parse_argv(int argc, char *argv[]) { return r; break; - OPTION_GROUP("Credentials"): - break; + OPTION_GROUP("Credentials"): {} OPTION_LONG("set-credential", "ID:VALUE", "Pass a credential with literal value to the VM"): r = machine_credential_set(&arg_credentials, arg); -- 2.47.3