diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-07-27 12:27:28 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-08-03 10:05:10 +0200 |
commit | 04499a70fbff3f6b798028473f5c9234a53eaa2d (patch) | |
tree | ec7a851e163ee20ba5211c16a86f1c251543e0a7 | |
parent | c7cfde640d2b32ff1eb893d1fcd291c25cd421e7 (diff) | |
download | systemd-04499a70fbff3f6b798028473f5c9234a53eaa2d.tar.gz |
Drop the text argument from assert_not_reached()
In general we almost never hit those asserts in production code, so users see
them very rarely, if ever. But either way, we just need something that users
can pass to the developers.
We have quite a few of those asserts, and some have fairly nice messages, but
many are like "WTF?" or "???" or "unexpected something". The error that is
printed includes the file location, and function name. In almost all functions
there's at most one assert, so the function name alone is enough to identify
the failure for a developer. So we don't get much extra from the message, and
we might just as well drop them.
Dropping them makes our code a tiny bit smaller, and most importantly, improves
development experience by making it easy to insert such an assert in the code
without thinking how to phrase the argument.
222 files changed, 380 insertions, 390 deletions
diff --git a/src/ac-power/ac-power.c b/src/ac-power/ac-power.c index 905da4ad87..c4bfe7cb18 100644 --- a/src/ac-power/ac-power.c +++ b/src/ac-power/ac-power.c @@ -53,7 +53,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (optind < argc) diff --git a/src/activate/activate.c b/src/activate/activate.c index 8c61c3ca7f..18ce491a84 100644 --- a/src/activate/activate.c +++ b/src/activate/activate.c @@ -453,7 +453,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (optind == argc) diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index c4685752f6..e7600934ea 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -2366,7 +2366,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option code."); + assert_not_reached(); } if (arg_scope == UNIT_FILE_GLOBAL && diff --git a/src/ask-password/ask-password.c b/src/ask-password/ask-password.c index 45305dec1f..a100679af2 100644 --- a/src/ask-password/ask-password.c +++ b/src/ask-password/ask-password.c @@ -188,7 +188,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (isempty(emoji) || streq(emoji, "auto")) diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c index 7c0970a60c..6fcf584667 100644 --- a/src/backlight/backlight.c +++ b/src/backlight/backlight.c @@ -495,7 +495,7 @@ static int run(int argc, char *argv[]) { return log_device_error_errno(device, r, "Failed to write %s: %m", saved); } else - assert_not_reached("Unknown verb."); + assert_not_reached(); return 0; } diff --git a/src/basic/architecture.c b/src/basic/architecture.c index 409632c3f4..e5dafb9814 100644 --- a/src/basic/architecture.c +++ b/src/basic/architecture.c @@ -136,7 +136,7 @@ int uname_architecture(void) { if (streq(arch_map[i].machine, u.machine)) return cached = arch_map[i].arch; - assert_not_reached("Couldn't identify architecture. You need to patch systemd."); + assert_not_reached(); return _ARCHITECTURE_INVALID; } diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c index 0decbb04e1..b51d70bc87 100644 --- a/src/basic/hashmap.c +++ b/src/basic/hashmap.c @@ -401,7 +401,7 @@ static struct hashmap_base_entry* bucket_at_virtual(HashmapBase *h, struct swap_ if (idx < _IDX_SWAP_END) return &bucket_at_swap(swap, idx)->p.b; - assert_not_reached("Invalid index"); + assert_not_reached(); } static dib_raw_t* dib_raw_ptr(HashmapBase *h) { @@ -513,7 +513,7 @@ static void* entry_value(HashmapBase *h, struct hashmap_base_entry *e) { return (void*) e->key; default: - assert_not_reached("Unknown hashmap type"); + assert_not_reached(); } } @@ -1747,7 +1747,7 @@ HashmapBase* _hashmap_copy(HashmapBase *h HASHMAP_DEBUG_PARAMS) { r = set_merge((Set*)copy, (Set*)h); break; default: - assert_not_reached("Unknown hashmap type"); + assert_not_reached(); } if (r < 0) diff --git a/src/basic/in-addr-util.c b/src/basic/in-addr-util.c index 9cc92a1c76..2187bd0cba 100644 --- a/src/basic/in-addr-util.c +++ b/src/basic/in-addr-util.c @@ -794,7 +794,7 @@ int in_addr_prefix_from_string_auto_internal( k = 0; break; default: - assert_not_reached("Invalid prefixlen mode"); + assert_not_reached(); } if (ret_family) diff --git a/src/basic/log.c b/src/basic/log.c index fb183ea9e7..bbc12a1cfb 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -863,12 +863,11 @@ _noreturn_ void log_assert_failed( } _noreturn_ void log_assert_failed_unreachable( - const char *text, const char *file, int line, const char *func) { - log_assert(LOG_CRIT, text, file, line, func, - "Code should not be reached '%s' at %s:%u, function %s(). Aborting."); + log_assert(LOG_CRIT, "Code should not be reached", file, line, func, + "%s at %s:%u, function %s(). Aborting."); abort(); } diff --git a/src/basic/log.h b/src/basic/log.h index 738c181070..9a17cd6c3d 100644 --- a/src/basic/log.h +++ b/src/basic/log.h @@ -174,7 +174,6 @@ _noreturn_ void log_assert_failed( const char *func); _noreturn_ void log_assert_failed_unreachable( - const char *text, const char *file, int line, const char *func); diff --git a/src/basic/macro.h b/src/basic/macro.h index 90f4e02d19..92498b0f20 100644 --- a/src/basic/macro.h +++ b/src/basic/macro.h @@ -282,8 +282,8 @@ static inline int __coverity_check_and_return__(int condition) { #define assert(expr) assert_message_se(expr, #expr) #endif -#define assert_not_reached(t) \ - log_assert_failed_unreachable(t, PROJECT_FILE, __LINE__, __PRETTY_FUNCTION__) +#define assert_not_reached() \ + log_assert_failed_unreachable(PROJECT_FILE, __LINE__, __PRETTY_FUNCTION__) #define assert_return(expr, r) \ do { \ diff --git a/src/basic/path-lookup.c b/src/basic/path-lookup.c index 05eb17d66c..987834b0d5 100644 --- a/src/basic/path-lookup.c +++ b/src/basic/path-lookup.c @@ -347,7 +347,7 @@ static int acquire_config_dirs(UnitFileScope scope, char **persistent, char **ru return 0; default: - assert_not_reached("Hmm, unexpected scope value."); + assert_not_reached(); } if (!a || !b) @@ -405,7 +405,7 @@ static int acquire_control_dirs(UnitFileScope scope, char **persistent, char **r return -EOPNOTSUPP; default: - assert_not_reached("Hmm, unexpected scope value."); + assert_not_reached(); } *persistent = TAKE_PTR(a); @@ -657,7 +657,7 @@ int lookup_paths_init( break; default: - assert_not_reached("Hmm, unexpected scope?"); + assert_not_reached(); } if (!add) @@ -807,7 +807,7 @@ char **generator_binary_paths(UnitFileScope scope) { break; default: - assert_not_reached("Hmm, unexpected scope."); + assert_not_reached(); } if (!add) diff --git a/src/basic/socket-util.h b/src/basic/socket-util.h index f92e425fd6..e857ae4341 100644 --- a/src/basic/socket-util.h +++ b/src/basic/socket-util.h @@ -245,7 +245,7 @@ struct cmsghdr* cmsg_find(struct msghdr *mh, int level, int type, socklen_t leng _len = sizeof(struct sockaddr_vm); \ break; \ default: \ - assert_not_reached("invalid socket family"); \ + assert_not_reached(); \ } \ _len; \ }) diff --git a/src/basic/stdio-util.h b/src/basic/stdio-util.h index 6dc1e72312..0ed48b3fd4 100644 --- a/src/basic/stdio-util.h +++ b/src/basic/stdio-util.h @@ -58,7 +58,7 @@ do { \ (void) va_arg(ap, long double); \ break; \ default: \ - assert_not_reached("Unknown format string argument."); \ + assert_not_reached(); \ } \ } \ } while (false) diff --git a/src/binfmt/binfmt.c b/src/binfmt/binfmt.c index 29530bb691..bf1861981a 100644 --- a/src/binfmt/binfmt.c +++ b/src/binfmt/binfmt.c @@ -174,7 +174,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if ((arg_unregister || arg_cat_config) && argc > optind) diff --git a/src/boot/bless-boot.c b/src/boot/bless-boot.c index 3fc319ca27..7d5a52841e 100644 --- a/src/boot/bless-boot.c +++ b/src/boot/bless-boot.c @@ -89,7 +89,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unknown option"); + assert_not_reached(); } return 1; diff --git a/src/boot/boot-check-no-failures.c b/src/boot/boot-check-no-failures.c index cb4f758cb4..78642063c4 100644 --- a/src/boot/boot-check-no-failures.c +++ b/src/boot/boot-check-no-failures.c @@ -67,7 +67,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unknown option"); + assert_not_reached(); } return 1; diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index 5d126f4bea..264189c36b 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -1228,7 +1228,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unknown option"); + assert_not_reached(); } return 1; diff --git a/src/busctl/busctl-introspect.c b/src/busctl/busctl-introspect.c index 89b32f4c73..4dbb11f15b 100644 --- a/src/busctl/busctl-introspect.c +++ b/src/busctl/busctl-introspect.c @@ -147,7 +147,7 @@ static int parse_xml_annotation(Context *context, uint64_t *flags) { break; default: - assert_not_reached("Bad state"); + assert_not_reached(); } } } diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index 8aa769e0f9..b9d84c9e58 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -121,7 +121,7 @@ static int acquire_bus(bool set_monitor, sd_bus **ret) { break; default: - assert_not_reached("Hmm, unknown transport type."); + assert_not_reached(); } } if (r < 0) @@ -718,7 +718,7 @@ static int format_cmdline(sd_bus_message *m, FILE *f, bool needs_space) { break; default: - assert_not_reached("Unknown basic type."); + assert_not_reached(); } needs_space = true; @@ -1957,7 +1957,7 @@ static int json_transform_one(sd_bus_message *m, JsonVariant **ret) { break; default: - assert_not_reached("Unexpected element type"); + assert_not_reached(); } *ret = TAKE_PTR(v); @@ -2525,7 +2525,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/cgls/cgls.c b/src/cgls/cgls.c index f39aa53da0..ab5f153d9d 100644 --- a/src/cgls/cgls.c +++ b/src/cgls/cgls.c @@ -141,7 +141,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (arg_machine && arg_show_unit != SHOW_UNIT_NONE) diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c index 50b0f63552..0104b6a543 100644 --- a/src/cgtop/cgtop.c +++ b/src/cgtop/cgtop.c @@ -885,7 +885,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (optind == argc - 1) diff --git a/src/core/dbus-socket.c b/src/core/dbus-socket.c index f45a5c16eb..a3b1e0442f 100644 --- a/src/core/dbus-socket.c +++ b/src/core/dbus-socket.c @@ -65,7 +65,7 @@ static int property_get_listen( break; default: - assert_not_reached("Unknown socket type"); + assert_not_reached(); } r = sd_bus_message_append(reply, "(ss)", socket_port_type_to_string(p), a); diff --git a/src/core/dynamic-user.c b/src/core/dynamic-user.c index 7da87fd818..2672496724 100644 --- a/src/core/dynamic-user.c +++ b/src/core/dynamic-user.c @@ -253,7 +253,7 @@ static int pick_uid(char **suggested_paths, const char *name, uid_t *ret_uid) { break; default: - assert_not_reached("unknown phase"); + assert_not_reached(); } /* Make sure whatever we picked here actually is in the right range */ diff --git a/src/core/emergency-action.c b/src/core/emergency-action.c index 9e8c79e67a..0234772b95 100644 --- a/src/core/emergency-action.c +++ b/src/core/emergency-action.c @@ -146,7 +146,7 @@ void emergency_action( break; default: - assert_not_reached("Unknown emergency action"); + assert_not_reached(); } } diff --git a/src/core/execute.c b/src/core/execute.c index 2b49e32474..4608956259 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -544,7 +544,7 @@ static int setup_input( } default: - assert_not_reached("Unknown input type"); + assert_not_reached(); } } @@ -730,7 +730,7 @@ static int setup_output( } default: - assert_not_reached("Unknown error type"); + assert_not_reached(); } } @@ -923,7 +923,7 @@ static int ask_for_confirmation(const char *vc, Unit *u, const char *cmdline) { r = CONFIRM_EXECUTE; break; default: - assert_not_reached("Unhandled choice"); + assert_not_reached(); } break; } diff --git a/src/core/job.c b/src/core/job.c index a526e5e4ee..dd16a0b280 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -407,7 +407,7 @@ bool job_type_is_redundant(JobType a, UnitActiveState b) { return true; default: - assert_not_reached("Invalid job type"); + assert_not_reached(); } } @@ -781,7 +781,7 @@ static int job_perform_on_unit(Job **j) { break; default: - assert_not_reached("Invalid job type"); + assert_not_reached(); } /* Log if the job still exists and the start/stop/reload function actually did something. Note that this means @@ -849,7 +849,7 @@ int job_run_and_invalidate(Job *j) { break; default: - assert_not_reached("Unknown job type"); + assert_not_reached(); } if (j) { diff --git a/src/core/main.c b/src/core/main.c index 473dc0920e..eb24245fb3 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -258,7 +258,7 @@ _noreturn_ static void crash(int sig) { pid = raw_getpid(); (void) kill(pid, sig); /* raise() would kill the parent */ - assert_not_reached("We shouldn't be here..."); + assert_not_reached(); _exit(EXIT_EXCEPTION); } else { siginfo_t status; @@ -1081,7 +1081,7 @@ static int parse_argv(int argc, char *argv[]) { return 0; default: - assert_not_reached("Unhandled option code."); + assert_not_reached(); } if (optind < argc && getpid_cached() != 1) @@ -2047,7 +2047,7 @@ static int invoke_main_loop( } default: - assert_not_reached("Unknown or unexpected manager objective."); + assert_not_reached(); } } } diff --git a/src/core/mount.c b/src/core/mount.c index 608ead5bc4..fb8f72e257 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -1223,7 +1223,7 @@ static int mount_stop(Unit *u) { return 0; default: - assert_not_reached("Unexpected state."); + assert_not_reached(); } } @@ -1383,7 +1383,7 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) { else if (code == CLD_DUMPED) f = MOUNT_FAILURE_CORE_DUMP; else - assert_not_reached("Unknown code"); + assert_not_reached(); if (IN_SET(m->state, MOUNT_REMOUNTING, MOUNT_REMOUNTING_SIGKILL, MOUNT_REMOUNTING_SIGTERM)) mount_set_reload_result(m, f); @@ -1465,7 +1465,7 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) { break; default: - assert_not_reached("Uh, control process died at wrong time."); + assert_not_reached(); } /* Notify clients about changed exit status */ @@ -1541,7 +1541,7 @@ static int mount_dispatch_timer(sd_event_source *source, usec_t usec, void *user break; default: - assert_not_reached("Timeout at wrong time."); + assert_not_reached(); } return 0; diff --git a/src/core/namespace.c b/src/core/namespace.c index 982aeeac19..e302e94848 100644 --- a/src/core/namespace.c +++ b/src/core/namespace.c @@ -570,7 +570,7 @@ static int append_protect_home(MountEntry **p, ProtectHome protect_home, bool ig return append_static_mounts(p, protect_home_yes_table, ELEMENTSOF(protect_home_yes_table), ignore_protect); default: - assert_not_reached("Unexpected ProtectHome= value"); + assert_not_reached(); } } @@ -592,7 +592,7 @@ static int append_protect_system(MountEntry **p, ProtectSystem protect_system, b return append_static_mounts(p, protect_system_full_table, ELEMENTSOF(protect_system_full_table), ignore_protect); default: - assert_not_reached("Unexpected ProtectSystem= value"); + assert_not_reached(); } } @@ -1359,7 +1359,7 @@ static int apply_one_mount( return mount_overlay(m); default: - assert_not_reached("Unknown mode"); + assert_not_reached(); } assert(what); diff --git a/src/core/scope.c b/src/core/scope.c index 1b60af22f3..560a7d9f3e 100644 --- a/src/core/scope.c +++ b/src/core/scope.c @@ -562,7 +562,7 @@ static int scope_dispatch_timer(sd_event_source *source, usec_t usec, void *user break; default: - assert_not_reached("Timeout at wrong time."); + assert_not_reached(); } return 0; diff --git a/src/core/service.c b/src/core/service.c index f4a79dc2af..ddcfeb8523 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -1683,7 +1683,7 @@ static bool service_shall_restart(Service *s, const char **reason) { return IN_SET(s->result, SERVICE_FAILURE_SIGNAL, SERVICE_FAILURE_CORE_DUMP); default: - assert_not_reached("unknown restart setting"); + assert_not_reached(); } } @@ -2157,7 +2157,7 @@ static void service_enter_start(Service *s) { service_set_main_pid(s, pid); service_set_state(s, SERVICE_START); } else - assert_not_reached("Unknown service type"); + assert_not_reached(); return; @@ -2780,7 +2780,7 @@ int service_deserialize_exec_command( return -ENOMEM; break; default: - assert_not_reached("Logic error in exec command deserialization"); + assert_not_reached(); } } @@ -3392,7 +3392,7 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { else if (code == CLD_DUMPED) f = SERVICE_FAILURE_CORE_DUMP; else - assert_not_reached("Unknown code"); + assert_not_reached(); if (s->main_pid == pid) { /* Clean up the exec_fd event source. We want to do this here, not later in @@ -3523,7 +3523,7 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { break; default: - assert_not_reached("Uh, main process died at wrong time."); + assert_not_reached(); } } @@ -3701,7 +3701,7 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { break; default: - assert_not_reached("Uh, control process died at wrong time."); + assert_not_reached(); } } } else /* Neither control nor main PID? If so, don't notify about anything */ @@ -3756,7 +3756,7 @@ static int service_dispatch_timer(sd_event_source *source, usec_t usec, void *us break; default: - assert_not_reached("unknown timeout mode"); + assert_not_reached(); } break; @@ -3796,7 +3796,7 @@ static int service_dispatch_timer(sd_event_source *source, usec_t usec, void *us break; default: - assert_not_reached("unknown timeout mode"); + assert_not_reached(); } break; @@ -3857,7 +3857,7 @@ static int service_dispatch_timer(sd_event_source *source, usec_t usec, void *us break; default: - assert_not_reached("unknown timeout mode"); + assert_not_reached(); } break; @@ -3912,7 +3912,7 @@ static int service_dispatch_timer(sd_event_source *source, usec_t usec, void *us break; default: - assert_not_reached("Timeout at wrong time."); + assert_not_reached(); } return 0; diff --git a/src/core/socket.c b/src/core/socket.c index 8a2a688450..675ad3c025 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -433,7 +433,7 @@ static void peer_address_hash_func(const SocketPeer *s, struct siphash *state) { else if (s->peer.sa.sa_family == AF_VSOCK) siphash24_compress(&s->peer.vm.svm_cid, sizeof(s->peer.vm.svm_cid), state); else - assert_not_reached("Unknown address family."); + assert_not_reached(); } static int peer_address_compare_func(const SocketPeer *x, const SocketPeer *y) { @@ -451,7 +451,7 @@ static int peer_address_compare_func(const SocketPeer *x, const SocketPeer *y) { case AF_VSOCK: return CMP(x->peer.vm.svm_cid, y->peer.vm.svm_cid); } - assert_not_reached("Black sheep in the family!"); + assert_not_reached(); } DEFINE_PRIVATE_HASH_OPS(peer_address_hash_ops, SocketPeer, peer_address_hash_func, peer_address_compare_func); @@ -558,7 +558,7 @@ _const_ static const char* listen_lookup(int family, int type) { else if (type == SOCK_SEQPACKET) return "ListenSequentialPacket"; - assert_not_reached("Unknown socket type"); + assert_not_reached(); return NULL; } @@ -914,7 +914,7 @@ static int instance_from_socket(int fd, unsigned nr, char **instance) { break; default: - assert_not_reached("Unhandled socket type."); + assert_not_reached(); } *instance = r; @@ -1724,7 +1724,7 @@ static int socket_open_fds(Socket *orig_s) { break; } default: - assert_not_reached("Unknown port type"); + assert_not_reached(); } } @@ -3071,7 +3071,7 @@ static void socket_sigchld_event(Unit *u, pid_t pid, int code, int status) { else if (code == CLD_DUMPED) f = SOCKET_FAILURE_CORE_DUMP; else - assert_not_reached("Unknown sigchld code"); + assert_not_reached(); if (s->control_command) { exec_status_exit(&s->control_command->exec_status, &s->exec_context, pid, code, status); @@ -3149,7 +3149,7 @@ static void socket_sigchld_event(Unit *u, pid_t pid, int code, int status) { break; default: - assert_not_reached("Uh, control process died at wrong time."); + assert_not_reached(); } } @@ -3226,7 +3226,7 @@ static int socket_dispatch_timer(sd_event_source *source, usec_t usec, void *use break; default: - assert_not_reached("Timeout at wrong time."); + assert_not_reached(); } return 0; diff --git a/src/core/swap.c b/src/core/swap.c index d7089f1c55..42d2e0242e 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -979,7 +979,7 @@ static int swap_stop(Unit *u) { return 0; default: - assert_not_reached("Unexpected state."); + assert_not_reached(); } } @@ -1073,7 +1073,7 @@ static void swap_sigchld_event(Unit *u, pid_t pid, int code, int status) { else if (code == CLD_DUMPED) f = SWAP_FAILURE_CORE_DUMP; else - assert_not_reached("Unknown code"); + assert_not_reached(); if (s->result == SWAP_SUCCESS) s->result = f; @@ -1118,7 +1118,7 @@ static void swap_sigchld_event(Unit *u, pid_t pid, int code, int status) { break; default: - assert_not_reached("Uh, control process died at wrong time."); + assert_not_reached(); } /* Notify clients about changed exit status */ @@ -1169,7 +1169,7 @@ static int swap_dispatch_timer(sd_event_source *source, usec_t usec, void *userd break; default: - assert_not_reached("Timeout at wrong time."); + assert_not_reached(); } return 0; diff --git a/src/core/timer.c b/src/core/timer.c index 2c7f304cdd..12515a6a75 100644 --- a/src/core/timer.c +++ b/src/core/timer.c @@ -473,7 +473,7 @@ static void timer_enter_waiting(Timer *t, bool time_change) { break; default: - assert_not_reached("Unknown timer base"); + assert_not_reached(); } v->next_elapse = usec_add(usec_shift_clock(base, CLOCK_MONOTONIC, TIMER_MONOTONIC_CLOCK(t)), v->value); @@ -797,7 +797,7 @@ static void timer_trigger_notify(Unit *u, Unit *other) { break; default: - assert_not_reached("Unknown timer state"); + assert_not_reached(); } } diff --git a/src/core/unit.c b/src/core/unit.c index c32317c863..6273926013 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -418,7 +418,7 @@ bool unit_may_gc(Unit *u) { break; default: - assert_not_reached("Unknown garbage collection mode"); + assert_not_reached(); } if (u->cgroup_path) { @@ -2591,7 +2591,7 @@ static bool unit_process_job(Job *j, UnitActiveState ns, UnitNotifyFlags flags) break; default: - assert_not_reached("Job type unknown"); + assert_not_reached(); } return unexpected; @@ -2983,7 +2983,7 @@ bool unit_job_is_applicable(Unit *u, JobType j) { return unit_can_reload(u) && unit_can_start(u); default: - assert_not_reached("Invalid job type"); + assert_not_reached(); } } @@ -4459,7 +4459,7 @@ static int operation_to_signal(const KillContext *c, KillOperation k, bool *note return c->watchdog_signal; default: - assert_not_reached("KillOperation unknown"); + assert_not_reached(); } } diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c index 8261bff213..d370de290a 100644 --- a/src/coredump/coredumpctl.c +++ b/src/coredump/coredumpctl.c @@ -331,7 +331,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (arg_since != USEC_INFINITY && arg_until != USEC_INFINITY && diff --git a/src/creds/creds.c b/src/creds/creds.c index c2a2eabbed..f880a79a82 100644 --- a/src/creds/creds.c +++ b/src/creds/creds.c @@ -232,7 +232,7 @@ static int transcode( return r; default: - assert_not_reached("Unexpected transcoding mode"); + assert_not_reached(); } } @@ -761,7 +761,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } } diff --git a/src/cryptenroll/cryptenroll-wipe.c b/src/cryptenroll/cryptenroll-wipe.c index 2255946643..8042a0fe83 100644 --- a/src/cryptenroll/cryptenroll-wipe.c +++ b/src/cryptenroll/cryptenroll-wipe.c @@ -367,7 +367,7 @@ int wipe_slots(struct crypt_device *cd, break; default: - assert_not_reached("Unexpected wipe scope"); + assert_not_reached(); } /* Then add all slots that match a token type */ diff --git a/src/cryptenroll/cryptenroll.c b/src/cryptenroll/cryptenroll.c index d253b2bc0d..f2e194e88c 100644 --- a/src/cryptenroll/cryptenroll.c +++ b/src/cryptenroll/cryptenroll.c @@ -358,7 +358,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } } diff --git a/src/delta/delta.c b/src/delta/delta.c index f78c6b9c0d..282168a584 100644 --- a/src/delta/delta.c +++ b/src/delta/delta.c @@ -625,7 +625,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/detect-virt/detect-virt.c b/src/detect-virt/detect-virt.c index bfdede6ce7..d284fcbe82 100644 --- a/src/detect-virt/detect-virt.c +++ b/src/detect-virt/detect-virt.c @@ -109,7 +109,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (optind < argc) diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c index 88bb3de40f..68c8bedc9b 100644 --- a/src/dissect/dissect.c +++ b/src/dissect/dissect.c @@ -287,7 +287,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } } @@ -344,7 +344,7 @@ static int parse_argv(int argc, char *argv[]) { break; default: - assert_not_reached("Unknown action."); + assert_not_reached(); } return 1; @@ -818,7 +818,7 @@ static int run(int argc, char *argv[]) { break; default: - assert_not_reached("Unknown action."); + assert_not_reached(); } return r; diff --git a/src/escape/escape.c b/src/escape/escape.c index 1575a68410..167305cb03 100644 --- a/src/escape/escape.c +++ b/src/escape/escape.c @@ -119,7 +119,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (optind >= argc) diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index 2cb4f80d5d..0a055c21c9 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -1299,7 +1299,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } /* We check if the specified locale strings are valid down here, so that we can take --root= into diff --git a/src/home/homectl.c b/src/home/homectl.c index 6273cb6c90..d3dbf2d534 100644 --- a/src/home/homectl.c +++ b/src/home/homectl.c @@ -3463,7 +3463,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } } diff --git a/src/home/homed-home.c b/src/home/homed-home.c index ef11c72b74..351b88df4e 100644 --- a/src/home/homed-home.c +++ b/src/home/homed-home.c @@ -957,7 +957,7 @@ static int home_on_worker_process(sd_event_source *s, const siginfo_t *si, void break; default: - assert_not_reached("Unexpected state after worker exited"); + assert_not_reached(); } return 0; diff --git a/src/home/homed-manager.c b/src/home/homed-manager.c index b255426382..6549e6bd4e 100644 --- a/src/home/homed-manager.c +++ b/src/home/homed-manager.c @@ -597,7 +597,7 @@ static int manager_acquire_uid( break; default: - assert_not_reached("unknown phase"); + assert_not_reached(); } other = hashmap_get(m->homes_by_uid, UID_TO_PTR(candidate)); diff --git a/src/home/homework-directory.c b/src/home/homework-directory.c index b35d24c85a..45a2fb9db7 100644 --- a/src/home/homework-directory.c +++ b/src/home/homework-directory.c @@ -141,7 +141,7 @@ int home_create_directory_or_subvolume(UserRecord *h, UserRecord **ret_home) { break; default: - assert_not_reached("unexpected storage"); + assert_not_reached(); } temporary = TAKE_PTR(d); /* Needs to be destroyed now */ diff --git a/src/home/homework.c b/src/home/homework.c index bdd9ac649e..ee1d4068ba 100644 --- a/src/home/homework.c +++ b/src/home/homework.c @@ -791,7 +791,7 @@ static int home_activate(UserRecord *h, UserRecord **ret_home) { break; default: - assert_not_reached("unexpected type"); + assert_not_reached(); } /* Note that the returned object might either be a reference to an updated version of the existing @@ -1305,7 +1305,7 @@ static int home_remove(UserRecord *h) { break; default: - assert_not_reached("unknown storage type"); + assert_not_reached(); } if (hd) { @@ -1370,7 +1370,7 @@ static int home_validate_update(UserRecord *h, HomeSetup *setup) { } default: - assert_not_reached("unexpected storage type"); + assert_not_reached(); } return has_mount; /* return true if the home record is already active */ diff --git a/src/home/user-record-util.c b/src/home/user-record-util.c index b5ed6b1689..ef8e18de61 100644 --- a/src/home/user-record-util.c +++ b/src/home/user-record-util.c @@ -544,7 +544,7 @@ int user_record_test_image_path(UserRecord *h) { return -ENOTDIR; default: - assert_not_reached("Unexpected record type"); + assert_not_reached(); } } diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c index 283038c7cb..bc78070131 100644 --- a/src/hostname/hostnamectl.c +++ b/src/hostname/hostnamectl.c @@ -620,7 +620,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c index 26cc83f31b..e2144df62c 100644 --- a/src/hwdb/hwdb.c +++ b/src/hwdb/hwdb.c @@ -98,7 +98,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unknown option"); + assert_not_reached(); } return 1; diff --git a/src/id128/id128.c b/src/id128/id128.c index 435a56d4f3..89b944f8c0 100644 --- a/src/id128/id128.c +++ b/src/id128/id128.c @@ -226,7 +226,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/import/export.c b/src/import/export.c index a4f3f6c38e..26533baeb8 100644 --- a/src/import/export.c +++ b/src/import/export.c @@ -261,7 +261,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/import/import-compress.c b/src/import/import-compress.c index aa837af565..03f5efa00e 100644 --- a/src/import/import-compress.c +++ b/src/import/import-compress.c @@ -190,7 +190,7 @@ int import_uncompress(ImportCompress *c, const void *data, size_t size, ImportCo #endif default: - assert_not_reached("Unknown compression"); + assert_not_reached(); } return 1; diff --git a/src/import/import-fs.c b/src/import/import-fs.c index e8c3740879..88bfe29970 100644 --- a/src/import/import-fs.c +++ b/src/import/import-fs.c @@ -290,7 +290,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/import/import.c b/src/import/import.c index fe4c03a4da..cc90732d71 100644 --- a/src/import/import.c +++ b/src/import/import.c @@ -278,7 +278,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/import/importd.c b/src/import/importd.c index f0f61ca784..0a87056819 100644 --- a/src/import/importd.c +++ b/src/import/importd.c @@ -431,7 +431,7 @@ static int transfer_start(Transfer *t) { break; default: - assert_not_reached("Unexpected transfer type"); + assert_not_reached(); } switch (t->type) { diff --git a/src/import/pull-job.c b/src/import/pull-job.c index 038fa2be8b..e751d3af05 100644 --- a/src/import/pull-job.c +++ b/src/import/pull-job.c @@ -421,7 +421,7 @@ static size_t pull_job_write_callback(void *contents, size_t size, size_t nmemb, goto fail; default: - assert_not_reached("Impossible state."); + assert_not_reached(); } return sz; diff --git a/src/import/pull-raw.c b/src/import/pull-raw.c index 9b5d8ef9e3..ca4f250210 100644 --- a/src/import/pull-raw.c +++ b/src/import/pull-raw.c @@ -222,7 +222,7 @@ static void raw_pull_report_progress(RawPull *i, RawProgress p) { break; default: - assert_not_reached("Unknown progress state"); + assert_not_reached(); } sd_notifyf(false, "X_IMPORT_PROGRESS=%u", percent); diff --git a/src/import/pull-tar.c b/src/import/pull-tar.c index a2ba56df2f..1227c89ffb 100644 --- a/src/import/pull-tar.c +++ b/src/import/pull-tar.c @@ -187,7 +187,7 @@ static void tar_pull_report_progress(TarPull *i, TarProgress p) { break; default: - assert_not_reached("Unknown progress state"); + assert_not_reached(); } sd_notifyf(false, "X_IMPORT_PROGRESS=%u", percent); diff --git a/src/import/pull.c b/src/import/pull.c index d24c71b00e..17ade56c2a 100644 --- a/src/import/pull.c +++ b/src/import/pull.c @@ -321,7 +321,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c index ab1cf7b109..38972fe1a9 100644 --- a/src/journal-remote/journal-gatewayd.c +++ b/src/journal-remote/journal-gatewayd.c @@ -992,7 +992,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (optind < argc) diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c index ae1d43756a..140ecac207 100644 --- a/src/journal-remote/journal-remote-main.c +++ b/src/journal-remote/journal-remote-main.c @@ -1003,7 +1003,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unknown option code."); + assert_not_reached(); } if (optind < argc) diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c index 6e5aebdc48..9c1ee0188d 100644 --- a/src/journal-remote/journal-remote.c +++ b/src/journal-remote/journal-remote.c @@ -58,7 +58,7 @@ static int open_output(RemoteServer *s, Writer *w, const char* host) { } default: - assert_not_reached("what?"); + assert_not_reached(); } r = journal_file_open_reliably(filename, @@ -110,7 +110,7 @@ int journal_remote_get_writer(RemoteServer *s, const char *host, Writer **writer break; default: - assert_not_reached("what split mode?"); + assert_not_reached(); } w = hashmap_get(s->writers, key); @@ -323,7 +323,7 @@ int journal_remote_server_init( else if (split_mode == JOURNAL_WRITE_SPLIT_HOST) s->output = REMOTE_JOURNAL_PATH; else - assert_not_reached("bad split mode"); + assert_not_reached(); r = sd_event_default(&s->events); if (r < 0) diff --git a/src/journal-remote/journal-upload-journal.c b/src/journal-remote/journal-upload-journal.c index f23d5cf8b9..899f47eea4 100644 --- a/src/journal-remote/journal-upload-journal.c +++ b/src/journal-remote/journal-upload-journal.c @@ -229,10 +229,10 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) { return pos; default: - assert_not_reached("WTF?"); + assert_not_reached(); } } - assert_not_reached("WTF?"); + assert_not_reached(); } static void check_update_watchdog(Uploader *u) { diff --git a/src/journal-remote/journal-upload.c b/src/journal-remote/journal-upload.c index 2a38d206ea..3c28bbab7a 100644 --- a/src/journal-remote/journal-upload.c +++ b/src/journal-remote/journal-upload.c @@ -779,7 +779,7 @@ static int parse_argv(int argc, char *argv[]) { argv[optind - 1]); default: - assert_not_reached("Unhandled option code."); + assert_not_reached(); } if (!arg_url) diff --git a/src/journal/cat.c b/src/journal/cat.c index 4ccc5e0a33..0c2c0d6152 100644 --- a/src/journal/cat.c +++ b/src/journal/cat.c @@ -115,7 +115,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index fe98aecf51..15c72d5d35 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -1046,7 +1046,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (arg_follow && !arg_no_tail && !arg_since && arg_lines == ARG_LINES_DEFAULT) @@ -2229,7 +2229,7 @@ int main(int argc, char *argv[]) { break; default: - assert_not_reached("Unknown action"); + assert_not_reached(); } if (arg_directory) @@ -2314,7 +2314,7 @@ int main(int argc, char *argv[]) { case ACTION_FLUSH: case ACTION_SYNC: case ACTION_ROTATE: - assert_not_reached("Unexpected action."); + assert_not_reached(); case ACTION_PRINT_HEADER: journal_print_header(j); @@ -2380,7 +2380,7 @@ int main(int argc, char *argv[]) { break; default: - assert_not_reached("Unknown action"); + assert_not_reached(); } if (arg_boot_offset != 0 && diff --git a/src/journal/journald-stream.c b/src/journal/journald-stream.c index c6720b6b13..0a90091a86 100644 --- a/src/journal/journald-stream.c +++ b/src/journal/journald-stream.c @@ -449,7 +449,7 @@ static int stdout_stream_line(StdoutStream *s, char *p, LineBreak line_break) { return stdout_stream_log(s, orig, line_break); } - assert_not_reached("Unknown stream state"); + assert_not_reached(); } static int stdout_stream_found( diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c index 7fe660466f..fb89f7c7f1 100644 --- a/src/libsystemd-network/sd-dhcp-client.c +++ b/src/libsystemd-network/sd-dhcp-client.c @@ -1308,7 +1308,7 @@ static int client_timeout_resend( goto error; default: - assert_not_reached("Unhandled choice"); + assert_not_reached(); } r = event_reset_time(client->event, &client->timeout_resend, @@ -1896,7 +1896,7 @@ static int client_handle_message(sd_dhcp_client *client, DHCPMessage *message, i r = -EINVAL; goto error; default: - assert_not_reached("invalid state"); + assert_not_reached(); } error: diff --git a/src/libsystemd-network/sd-ipv4acd.c b/src/libsystemd-network/sd-ipv4acd.c index c6aa9aa11a..6a39f44e6c 100644 --- a/src/libsystemd-network/sd-ipv4acd.c +++ b/src/libsystemd-network/sd-ipv4acd.c @@ -293,7 +293,7 @@ static int ipv4acd_on_timeout(sd_event_source *s, uint64_t usec, void *userdata) break; default: - assert_not_reached("Invalid state."); + assert_not_reached(); } return 0; @@ -409,7 +409,7 @@ static int ipv4acd_on_packet( break; default: - assert_not_reached("Invalid state."); + assert_not_reached(); } return 0; diff --git a/src/libsystemd-network/sd-ipv4ll.c b/src/libsystemd-network/sd-ipv4ll.c index 7b9d63ca3c..f2cc22db26 100644 --- a/src/libsystemd-network/sd-ipv4ll.c +++ b/src/libsystemd-network/sd-ipv4ll.c @@ -360,7 +360,7 @@ void ipv4ll_on_acd(sd_ipv4acd *acd, int event, void *userdata) { break; default: - assert_not_reached("Invalid IPv4ACD event."); + assert_not_reached(); } return; diff --git a/src/libsystemd-network/test-acd.c b/src/libsystemd-network/test-acd.c index f4aab85ed4..e369f5a592 100644 --- a/src/libsystemd-network/test-acd.c +++ b/src/libsystemd-network/test-acd.c @@ -30,7 +30,7 @@ static void acd_handler(sd_ipv4acd *acd, int event, void *userdata) { log_error("the client was stopped"); break; default: - assert_not_reached("invalid ACD event"); + assert_not_reached(); } } diff --git a/src/libsystemd-network/test-dhcp-client.c b/src/libsystemd-network/test-dhcp-client.c index 6e0fdcd769..10db7f6c4b 100644 --- a/src/libsystemd-network/test-dhcp-client.c +++ b/src/libsystemd-network/test-dhcp-client.c @@ -34,7 +34,7 @@ static be32_t xid; static sd_event_source *test_hangcheck; static int test_dhcp_hangcheck(sd_event_source *s, uint64_t usec, void *userdata) { - assert_not_reached("Test case should have completed in 2 seconds"); + assert_not_reached(); return 0; } diff --git a/src/libsystemd-network/test-dhcp6-client.c b/src/libsystemd-network/test-dhcp6-client.c index a72c13684d..5511350489 100644 --- a/src/libsystemd-network/test-dhcp6-client.c +++ b/src/libsystemd-network/test-dhcp6-client.c @@ -560,10 +560,8 @@ static int test_advertise_option(sd_event *e) { return 0; } -static int test_hangcheck(sd_event_source *s, uint64_t usec, void *userdata) { - assert_not_reached("Test case should have completed in 2 seconds"); - - return 0; +static int test_check_completed_in_2_seconds(sd_event_source *s, uint64_t usec, void *userdata) { + assert_not_reached(); } static void test_client_solicit_cb(sd_dhcp6_client *client, int event, @@ -861,14 +859,8 @@ static int test_client_verify_information_request(DHCP6Message *information_requ break; case SD_DHCP6_OPTION_IA_NA: - assert_not_reached("IA TA option must not be present"); - - break; - case SD_DHCP6_OPTION_SERVERID: - assert_not_reached("Server ID option must not be present"); - - break; + assert_not_reached(); case SD_DHCP6_OPTION_ELAPSED_TIME: assert_se(!found_elapsed_time); @@ -965,7 +957,7 @@ static int test_client_solicit(sd_event *e) { assert_se(sd_event_add_time_relative(e, &hangcheck, clock_boottime_or_monotonic(), 2 * USEC_PER_SEC, 0, - test_hangcheck, NULL) >= 0); + test_check_completed_in_2_seconds, NULL) >= 0); assert_se(sd_dhcp6_client_set_local_address(client, &address) >= 0); diff --git a/src/libsystemd-network/test-ipv4ll-manual.c b/src/libsystemd-network/test-ipv4ll-manual.c index a253acbd83..3fea894f30 100644 --- a/src/libsystemd-network/test-ipv4ll-manual.c +++ b/src/libsystemd-network/test-ipv4ll-manual.c @@ -38,7 +38,7 @@ static void ll_handler(sd_ipv4ll *ll, int event, void *userdata) { log_error("the client was stopped with address %s", strna(address)); break; default: - assert_not_reached("invalid LL event"); + assert_not_reached(); } } diff --git a/src/libsystemd/sd-bus/bus-dump.c b/src/libsystemd/sd-bus/bus-dump.c index 65b188e88e..d50cd1eedd 100644 --- a/src/libsystemd/sd-bus/bus-dump.c +++ b/src/libsystemd/sd-bus/bus-dump.c @@ -259,7 +259,7 @@ _public_ int sd_bus_message_dump(sd_bus_message *m, FILE *f, uint64_t flags) { break; default: - assert_not_reached("Unknown basic type."); + assert_not_reached(); } } diff --git a/src/libsystemd/sd-bus/bus-gvariant.c b/src/libsystemd/sd-bus/bus-gvariant.c index 850540a785..07decfd1f3 100644 --- a/src/libsystemd/sd-bus/bus-gvariant.c +++ b/src/libsystemd/sd-bus/bus-gvariant.c @@ -87,7 +87,7 @@ int bus_gvariant_get_size(const char *signature) { return -EINVAL; default: - assert_not_reached("Unknown signature type"); + assert_not_reached(); } p += n; @@ -164,7 +164,7 @@ int bus_gvariant_get_alignment(const char *signature) { } default: - assert_not_reached("Unknown signature type"); + assert_not_reached(); } if (a < 0) @@ -229,7 +229,7 @@ int bus_gvariant_is_fixed_size(const char *signature) { } default: - assert_not_reached("Unknown signature type"); + assert_not_reached(); } p += n; @@ -270,7 +270,7 @@ size_t bus_gvariant_read_word_le(void *p, size_t sz) { else if (sz == 8) return le64toh(x.u64); - assert_not_reached("unknown word width"); + assert_not_reached(); } void bus_gvariant_write_word_le(void *p, size_t sz, size_t value) { @@ -293,7 +293,7 @@ void bus_gvariant_write_word_le(void *p, size_t sz, size_t value) { else if (sz == 8) x.u64 = htole64((uint64_t) value); else - assert_not_reached("unknown word width"); + assert_not_reached(); memcpy(p, &x, sz); } diff --git a/src/libsystemd/sd-bus/bus-match.c b/src/libsystemd/sd-bus/bus-match.c index 648f1ca62f..ff8cf4ee0e 100644 --- a/src/libsystemd/sd-bus/bus-match.c +++ b/src/libsystemd/sd-bus/bus-match.c @@ -199,7 +199,7 @@ static bool value_node_test( return false; default: - assert_not_reached("Invalid node type"); + assert_not_reached(); } } @@ -234,7 +234,7 @@ static bool value_node_same( return streq(node->value.str, value_str); default: - assert_not_reached("Invalid node type"); + assert_not_reached(); } } @@ -375,7 +375,7 @@ int bus_match_run( break; default: - assert_not_reached("Unknown match type."); + assert_not_reached(); } if (BUS_MATCH_CAN_HASH(node->type)) { diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c index 20f7396c74..954b159bf2 100644 --- a/src/libsystemd/sd-bus/bus-message.c +++ b/src/libsystemd/sd-bus/bus-message.c @@ -2275,7 +2275,7 @@ _public_ int sd_bus_message_close_container(sd_bus_message *m) { else if (IN_SET(c->enclosing, SD_BUS_TYPE_STRUCT, SD_BUS_TYPE_DICT_ENTRY)) r = bus_message_close_struct(m, c, true); else - assert_not_reached("Unknown container type"); + assert_not_reached(); free(c->signature); free(c->offsets); @@ -3247,7 +3247,7 @@ static int container_next_item(sd_bus_message *m, struct bus_container *c, size_ } else if (c->enclosing == SD_BUS_TYPE_VARIANT) goto end; else - assert_not_reached("Unknown container type"); + assert_not_reached(); return 0; @@ -3460,7 +3460,7 @@ _public_ int sd_bus_message_read_basic(sd_bus_message *m, char type, void *p) { } default: - assert_not_reached("unexpected type"); + assert_not_reached(); } } @@ -3575,7 +3575,7 @@ _public_ int sd_bus_message_read_basic(sd_bus_message *m, char type, void *p) { } default: - assert_not_reached("Unknown basic type..."); + assert_not_reached(); } } } diff --git a/src/libsystemd/sd-bus/bus-slot.c b/src/libsystemd/sd-bus/bus-slot.c index a0009a7a87..9f289575ef 100644 --- a/src/libsystemd/sd-bus/bus-slot.c +++ b/src/libsystemd/sd-bus/bus-slot.c @@ -161,7 +161,7 @@ void bus_slot_disconnect(sd_bus_slot *slot, bool unref) { break; default: - assert_not_reached("Wut? Unknown slot type?"); + assert_not_reached(); } bus = slot->bus; diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index 6960161c36..0e5c8cf477 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -2545,7 +2545,7 @@ _public_ int sd_bus_get_events(sd_bus *bus) { break; default: - assert_not_reached("Unknown state"); + assert_not_reached(); } return flags; @@ -2604,7 +2604,7 @@ _public_ int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec) { return 0; default: - assert_not_reached("Unknown or unexpected stat"); + assert_not_reached(); } } @@ -3063,7 +3063,7 @@ static int bus_exit_now(sd_bus *bus) { else exit(EXIT_FAILURE); - assert_not_reached("exit() didn't exit?"); + assert_not_reached(); } static int process_closing_reply_callback(sd_bus *bus, struct reply_callback *c) { @@ -3234,7 +3234,7 @@ static int bus_process_internal(sd_bus *bus, sd_bus_message **ret) { return process_closing(bus, ret); default: - assert_not_reached("Unknown state"); + assert_not_reached(); } if (ERRNO_IS_DISCONNECT(r)) { diff --git a/src/libsystemd/sd-bus/test-bus-benchmark.c b/src/libsystemd/sd-bus/test-bus-benchmark.c index 13c08fe295..317653bedc 100644 --- a/src/libsystemd/sd-bus/test-bus-benchmark.c +++ b/src/libsystemd/sd-bus/test-bus-benchmark.c @@ -57,7 +57,7 @@ static void server(sd_bus *b, size_t *result) { return; } else if (!sd_bus_message_is_signal(m, NULL, NULL)) - assert_not_reached("Unknown method"); + assert_not_reached(); } } diff --git a/src/libsystemd/sd-bus/test-bus-signature.c b/src/libsystemd/sd-bus/test-bus-signature.c index ea7efe68e4..ba94804869 100644 --- a/src/libsystemd/sd-bus/test-bus-signature.c +++ b/src/libsystemd/sd-bus/test-bus-signature.c @@ -121,7 +121,7 @@ int main(int argc, char *argv[]) { OBJECT_PATH_FOREACH_PREFIX(prefix, "/") { log_info("<%s>", prefix); - assert_not_reached("???"); + assert_not_reached(); } r = 0; diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index 388128bf33..02049db667 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@ -639,7 +639,7 @@ int device_read_uevent_file(sd_device *device) { break; default: - assert_not_reached("Invalid state when parsing uevent file"); + assert_not_reached(); } if (major) { diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index e9199deb41..cb8f54b1d5 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -915,7 +915,7 @@ static void source_disconnect(sd_event_source *s) { } default: - assert_not_reached("Wut? I shouldn't exist."); + assert_not_reached(); } if (s->pending) @@ -2407,7 +2407,7 @@ static int event_source_offline( break; default: - assert_not_reached("Wut? I shouldn't exist."); + assert_not_reached(); } /* Always reshuffle time prioq, as the ratelimited flag may be changed. */ @@ -2495,7 +2495,7 @@ static int event_source_online( break; default: - assert_not_reached("Wut? I shouldn't exist."); + assert_not_reached(); } s->enabled = enabled; @@ -3569,7 +3569,7 @@ static int source_dispatch(sd_event_source *s) { case SOURCE_WATCHDOG: case _SOURCE_EVENT_SOURCE_TYPE_MAX: case _SOURCE_EVENT_SOURCE_TYPE_INVALID: - assert_not_reached("Wut? I shouldn't exist."); + assert_not_reached(); } s->dispatching = false; @@ -3929,7 +3929,7 @@ static int process_epoll(sd_event *e, usec_t timeout, int64_t threshold, int64_t break; default: - assert_not_reached("Unexpected event source type"); + assert_not_reached(); } break; @@ -3953,7 +3953,7 @@ static int process_epoll(sd_event *e, usec_t timeout, int64_t threshold, int64_t break; default: - assert_not_reached("Invalid wake-up pointer"); + assert_not_reached(); } } if (r < 0) diff --git a/src/libsystemd/sd-event/test-event.c b/src/libsystemd/sd-event/test-event.c index 9b92dac650..e28885b5e0 100644 --- a/src/libsystemd/sd-event/test-event.c +++ b/src/libsystemd/sd-event/test-event.c @@ -55,7 +55,7 @@ static int io_handler(sd_event_source *s, int fd, uint32_t revents, void *userda else assert_se(sd_event_source_set_enabled(s, SD_EVENT_OFF) >= 0); } else - assert_not_reached("Yuck!"); + assert_not_reached(); return 1; } @@ -170,7 +170,7 @@ static int time_handler(sd_event_source *s, uint64_t usec, void *userdata) { got_c = true; } } else - assert_not_reached("Huh?"); + assert_not_reached(); return 2; } @@ -452,7 +452,7 @@ static int inotify_handler(sd_event_source *s, const struct inotify_event *ev, v log_info("inotify-handler <%s>: delete of %s", description, ev->name); assert_se(streq(ev->name, "sub")); } else - assert_not_reached("unexpected inotify event"); + assert_not_reached(); maybe_exit(s, c); return 1; @@ -470,7 +470,7 @@ static int delete_self_handler(sd_event_source *s, const struct inotify_event *e } else if (ev->mask & IN_IGNORED) { log_info("delete-self-handler: ignore"); } else - assert_not_reached("unexpected inotify event (delete-self)"); + assert_not_reached(); maybe_exit(s, c); return 1; diff --git a/src/libsystemd/sd-journal/sd-journal.c b/src/libsystemd/sd-journal/sd-journal.c index 5728c537bc..e2be01d375 100644 --- a/src/libsystemd/sd-journal/sd-journal.c +++ b/src/libsystemd/sd-journal/sd-journal.c @@ -190,7 +190,7 @@ static bool same_field(const void *_a, size_t s, const void *_b, size_t t) { return true; } - assert_not_reached("\"=\" not found"); + assert_not_reached(); } static Match *match_new(Match *p, MatchType t) { diff --git a/src/libsystemd/sd-journal/test-compress-benchmark.c b/src/libsystemd/sd-journal/test-compress-benchmark.c index eb3459e27e..f222bf3021 100644 --- a/src/libsystemd/sd-journal/test-compress-benchmark.c +++ b/src/libsystemd/sd-journal/test-compress-benchmark.c @@ -68,7 +68,7 @@ static char* make_buf(size_t count, const char *type) { random_bytes(buf + 8*step, step); memzero(buf + 9*step, step); } else - assert_not_reached("here"); + assert_not_reached(); return buf; } diff --git a/src/libsystemd/sd-netlink/netlink-message.c b/src/libsystemd/sd-netlink/netlink-message.c index 473d74b01a..c4dc4e67dd 100644 --- a/src/libsystemd/sd-netlink/netlink-message.c +++ b/src/libsystemd/sd-netlink/netlink-message.c @@ -1163,7 +1163,7 @@ int sd_netlink_message_enter_container(sd_netlink_message *m, unsigned short typ break; } default: - assert_not_reached("sd-netlink: invalid type system union type"); + assert_not_reached(); } } else return -EINVAL; diff --git a/src/libsystemd/sd-netlink/netlink-slot.c b/src/libsystemd/sd-netlink/netlink-slot.c index b6de545fe2..76b4ccaa96 100644 --- a/src/libsystemd/sd-netlink/netlink-slot.c +++ b/src/libsystemd/sd-netlink/netlink-slot.c @@ -92,7 +92,7 @@ void netlink_slot_disconnect(sd_netlink_slot *slot, bool unref) { break; default: - assert_not_reached("Wut? Unknown slot type?"); + assert_not_reached(); } slot->type = _NETLINK_SLOT_INVALID; diff --git a/src/libsystemd/sd-netlink/rtnl-message.c b/src/libsystemd/sd-netlink/rtnl-message.c index e771b95e08..a5a2f4424f 100644 --- a/src/libsystemd/sd-netlink/rtnl-message.c +++ b/src/libsystemd/sd-netlink/rtnl-message.c @@ -288,7 +288,7 @@ int sd_rtnl_message_new_nexthop(sd_netlink *rtnl, sd_netlink_message **ret, assert_return(IN_SET(nh_family, AF_UNSPEC, AF_INET, AF_INET6), -EINVAL); break; default: - assert_not_reached("Invalid message type."); + assert_not_reached(); } assert_return(ret, -EINVAL); diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c index ee973c0692..c8af16a918 100644 --- a/src/libsystemd/sd-resolve/sd-resolve.c +++ b/src/libsystemd/sd-resolve/sd-resolve.c @@ -397,7 +397,7 @@ static int handle_request(int out_fd, const Packet *packet, size_t length) { return -ECONNRESET; default: - assert_not_reached("Unknown request"); + assert_not_reached(); } return 0; @@ -661,7 +661,7 @@ static int complete_query(sd_resolve *resolve, sd_resolve_query *q) { break; default: - assert_not_reached("Cannot complete unknown query type"); + assert_not_reached(); } resolve->current = NULL; diff --git a/src/libsystemd/sd-resolve/test-resolve.c b/src/libsystemd/sd-resolve/test-resolve.c index b973dfd90d..647bd1e381 100644 --- a/src/libsystemd/sd-resolve/test-resolve.c +++ b/src/libsystemd/sd-resolve/test-resolve.c @@ -99,7 +99,7 @@ int main(int argc, char *argv[]) { } if (r < 0) { log_error_errno(r, "sd_resolve_wait(): %m"); - assert_not_reached("sd_resolve_wait() failed"); + assert_not_reached(); } } diff --git a/src/libudev/test-libudev.c b/src/libudev/test-libudev.c index a751056795..354ded3a2b 100644 --- a/src/libudev/test-libudev.c +++ b/src/libudev/test-libudev.c @@ -445,7 +445,7 @@ static int parse_args(int argc, char *argv[], const char **syspath, const char * return -EINVAL; default: - assert_not_reached("Unhandled option code."); + assert_not_reached(); } return 1; diff --git a/src/locale/keymap-util.c b/src/locale/keymap-util.c index d2f0566dbc..d48f0b4216 100644 --- a/src/locale/keymap-util.c +++ b/src/locale/keymap-util.c @@ -691,7 +691,7 @@ int find_language_fallback(const char *lang, char **language) { } } - assert_not_reached("should not be here"); + assert_not_reached(); } int x11_convert_to_vconsole(Context *c) { diff --git a/src/locale/localectl.c b/src/locale/localectl.c index 548ac8eb2c..0de3532f97 100644 --- a/src/locale/localectl.c +++ b/src/locale/localectl.c @@ -293,7 +293,7 @@ static int list_x11_keymaps(int argc, char **argv, void *userdata) { else if (streq(argv[0], "list-x11-keymap-options")) look_for = OPTIONS; else - assert_not_reached("Wrong parameter"); + assert_not_reached(); for (;;) { _cleanup_free_ char *line = NULL; @@ -474,7 +474,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/login/inhibit.c b/src/login/inhibit.c index e871628b9a..ff5a5d06f5 100644 --- a/src/login/inhibit.c +++ b/src/login/inhibit.c @@ -256,7 +256,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (arg_action == ACTION_INHIBIT && optind == argc) diff --git a/src/login/loginctl.c b/src/login/loginctl.c index 4b5598ecf6..846a31012e 100644 --- a/src/login/loginctl.c +++ b/src/login/loginctl.c @@ -1412,7 +1412,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index 999a609519..ccda0bdec4 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -2141,7 +2141,7 @@ static int manager_scheduled_shutdown_handler( else if (streq(m->scheduled_shutdown_type, "halt")) target = SPECIAL_HALT_TARGET; else - assert_not_reached("unexpected shutdown type"); + assert_not_reached(); /* Don't allow multiple jobs being executed at the same time */ if (m->action_what > 0) { diff --git a/src/login/user-runtime-dir.c b/src/login/user-runtime-dir.c index 07d72d214d..a1087ed31c 100644 --- a/src/login/user-runtime-dir.c +++ b/src/login/user-runtime-dir.c @@ -207,7 +207,7 @@ static int run(int argc, char *argv[]) { return do_mount(argv[2]); if (streq(argv[1], "stop")) return do_umount(argv[2]); - assert_not_reached("Unknown verb!"); + assert_not_reached(); } DEFINE_MAIN_FUNCTION(run); diff --git a/src/machine-id-setup/machine-id-setup-main.c b/src/machine-id-setup/machine-id-setup-main.c index 5af6bfeafe..0f8bc43ab5 100644 --- a/src/machine-id-setup/machine-id-setup-main.c +++ b/src/machine-id-setup/machine-id-setup-main.c @@ -110,7 +110,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (optind < argc) diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index 299e6d8207..b4c251078b 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -2789,7 +2789,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } } diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c index b2a41a7e75..eda847cb4a 100644 --- a/src/modules-load/modules-load.c +++ b/src/modules-load/modules-load.c @@ -152,7 +152,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/mount/mount-tool.c b/src/mount/mount-tool.c index c213c905a1..b0de83b8d0 100644 --- a/src/mount/mount-tool.c +++ b/src/mount/mount-tool.c @@ -329,7 +329,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (arg_user && arg_transport != BUS_TRANSPORT_LOCAL) @@ -1530,7 +1530,7 @@ static int run(int argc, char* argv[]) { break; default: - assert_not_reached("Unexpected action."); + assert_not_reached(); } return r; diff --git a/src/network/generator/main.c b/src/network/generator/main.c index 1ac8bf01c5..624b0a0b5d 100644 --- a/src/network/generator/main.c +++ b/src/network/generator/main.c @@ -157,7 +157,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/network/netdev/fou-tunnel.c b/src/network/netdev/fou-tunnel.c index 6863257a58..0ed0df7579 100644 --- a/src/network/netdev/fou-tunnel.c +++ b/src/network/netdev/fou-tunnel.c @@ -58,7 +58,7 @@ static int netdev_fill_fou_tunnel_message(NetDev *netdev, sd_netlink_message **r encap_type = FOU_ENCAP_GUE; break; default: - assert_not_reached("invalid encap type"); + assert_not_reached(); } r = sd_netlink_message_append_u8(m, FOU_ATTR_TYPE, encap_type); @@ -243,7 +243,7 @@ static int netdev_fou_tunnel_verify(NetDev *netdev, const char *filename) { filename); break; default: - assert_not_reached("Invalid fou encap type"); + assert_not_reached(); } if (t->peer_family == AF_UNSPEC && t->peer_port > 0) diff --git a/src/network/netdev/netdev.c b/src/network/netdev/netdev.c index 53534d4873..c3ab6aecdb 100644 --- a/src/network/netdev/netdev.c +++ b/src/network/netdev/netdev.c @@ -528,7 +528,7 @@ int netdev_join(NetDev *netdev, Link *link, link_netlink_message_handler_t callb return r; break; default: - assert_not_reached("Cannot join independent netdev"); + assert_not_reached(); } return 0; diff --git a/src/network/netdev/tunnel.c b/src/network/netdev/tunnel.c index 23718081b9..f27a1e4335 100644 --- a/src/network/netdev/tunnel.c +++ b/src/network/netdev/tunnel.c @@ -128,7 +128,7 @@ static int netdev_gre_erspan_fill_message_create(NetDev *netdev, Link *link, sd_ t = GRETAP(netdev); break; default: - assert_not_reached("invalid netdev kind"); + assert_not_reached(); } assert(t); @@ -457,7 +457,7 @@ static int netdev_tunnel_verify(NetDev *netdev, const char *filename) { t = ERSPAN(netdev); break; default: - assert_not_reached("Invalid tunnel kind"); + assert_not_reached(); } assert(t); @@ -722,7 +722,7 @@ static void ipip_sit_init(NetDev *n) { t = SIT(n); break; default: - assert_not_reached("invalid netdev kind"); + assert_not_reached(); } assert(t); @@ -763,7 +763,7 @@ static void gre_erspan_init(NetDev *n) { t = GRETAP(n); break; default: - assert_not_reached("invalid netdev kind"); + assert_not_reached(); } assert(t); diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 0ebb11cefa..09a19192bc 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -2970,7 +2970,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } } diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index f4257b3b91..4df799e548 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -1428,7 +1428,7 @@ int manager_rtnl_process_address(sd_netlink *rtnl, sd_netlink_message *message, break; default: - assert_not_reached("Received unsupported address family"); + assert_not_reached(); } r = sd_netlink_message_read_cache_info(message, IFA_CACHEINFO, &tmp->cinfo); @@ -1469,7 +1469,7 @@ int manager_rtnl_process_address(sd_netlink *rtnl, sd_netlink_message *message, break; default: - assert_not_reached("Received invalid RTNL message type"); + assert_not_reached(); } return 1; diff --git a/src/network/networkd-bridge-mdb.c b/src/network/networkd-bridge-mdb.c index 0f808fb515..6eca470826 100644 --- a/src/network/networkd-bridge-mdb.c +++ b/src/network/networkd-bridge-mdb.c @@ -168,7 +168,7 @@ static int bridge_mdb_configure(BridgeMDB *mdb, Link *link, link_netlink_message break; default: - assert_not_reached("Invalid address family"); + assert_not_reached(); } /* create new RTM message */ diff --git a/src/network/networkd-dhcp-server.c b/src/network/networkd-dhcp-server.c index 9e2faa5675..e4be034a4c 100644 --- a/src/network/networkd-dhcp-server.c +++ b/src/network/networkd-dhcp-server.c @@ -202,7 +202,7 @@ static int link_push_uplink_to_dhcp_server( break; default: - assert_not_reached("Unexpected server type"); + assert_not_reached(); } if (use_dhcp_lease_data && link->dhcp_lease) { diff --git a/src/network/networkd-dhcp4.c b/src/network/networkd-dhcp4.c index 8936e68a33..c986031b87 100644 --- a/src/network/networkd-dhcp4.c +++ b/src/network/networkd-dhcp4.c @@ -1389,7 +1389,7 @@ static int dhcp4_set_client_identifier(Link *link) { break; } default: - assert_not_reached("Unknown client identifier type."); + assert_not_reached(); } return 0; diff --git a/src/network/networkd-ipv4acd.c b/src/network/networkd-ipv4acd.c index c2cadc0a30..5c57032f2a 100644 --- a/src/network/networkd-ipv4acd.c +++ b/src/network/networkd-ipv4acd.c @@ -117,7 +117,7 @@ static void on_acd(sd_ipv4acd *acd, int event, void *userdata, bool is_static) { break; default: - assert_not_reached("Invalid IPv4ACD event."); + assert_not_reached(); } } diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 97a4cafad4..3a56f89f0b 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -2481,7 +2481,7 @@ int manager_rtnl_process_link(sd_netlink *rtnl, sd_netlink_message *message, Man break; default: - assert_not_reached("Received link message with invalid RTNL message type."); + assert_not_reached(); } return 1; diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c index efc4707855..96a3ef9cb8 100644 --- a/src/network/networkd-ndisc.c +++ b/src/network/networkd-ndisc.c @@ -1350,7 +1350,7 @@ static void ndisc_handler(sd_ndisc *nd, sd_ndisc_event_t event, sd_ndisc_router } break; default: - assert_not_reached("Unknown NDisc event"); + assert_not_reached(); } } diff --git a/src/network/networkd-neighbor.c b/src/network/networkd-neighbor.c index b23f081bfb..d5a8b6e97e 100644 --- a/src/network/networkd-neighbor.c +++ b/src/network/networkd-neighbor.c @@ -595,7 +595,7 @@ int manager_rtnl_process_neighbor(sd_netlink *rtnl, sd_netlink_message *message, break; default: - assert_not_reached("Received invalid RTNL message type"); + assert_not_reached(); } return 1; diff --git a/src/network/networkd-nexthop.c b/src/network/networkd-nexthop.c index 87f4ee4b10..92cbb1c843 100644 --- a/src/network/networkd-nexthop.c +++ b/src/network/networkd-nexthop.c @@ -1012,7 +1012,7 @@ int manager_rtnl_process_nexthop(sd_netlink *rtnl, sd_netlink_message *message, break; default: - assert_not_reached("Received invalid RTNL message type"); + assert_not_reached(); } return 1; @@ -1227,7 +1227,7 @@ int config_parse_nexthop_family( n->family = AF_INET6; break; default: - assert_not_reached("Invalid family."); + assert_not_reached(); } TAKE_PTR(n); diff --git a/src/network/networkd-queue.c b/src/network/networkd-queue.c index 5ef4acf5ac..db682d434b 100644 --- a/src/network/networkd-queue.c +++ b/src/network/networkd-queue.c @@ -53,7 +53,7 @@ static void request_free_object(RequestType type, void *object) { case REQUEST_TYPE_UP_DOWN: break; default: - assert_not_reached("invalid request type."); + assert_not_reached(); } } @@ -134,7 +134,7 @@ static void request_hash_func(const Request *req, struct siphash *state) { case REQUEST_TYPE_UP_DOWN: break; default: - assert_not_reached("invalid request type."); + assert_not_reached(); } } @@ -181,7 +181,7 @@ static int request_compare_func(const struct Request *a, const struct Request *b case REQUEST_TYPE_UP_DOWN: return 0; default: - assert_not_reached("invalid request type."); + assert_not_reached(); } } diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c index b6c19223b6..d8daa947be 100644 --- a/src/network/networkd-route.c +++ b/src/network/networkd-route.c @@ -1881,7 +1881,7 @@ static int process_route_one(Manager *manager, Link *link, uint16_t type, const break; default: - assert_not_reached("Received route message with invalid RTNL message type"); + assert_not_reached(); } return 1; @@ -2335,7 +2335,7 @@ int config_parse_destination( buffer = &n->src; prefixlen = &n->src_prefixlen; } else - assert_not_reached(lvalue); + assert_not_reached(); if (n->family == AF_UNSPEC) r = in_addr_prefix_from_string_auto(rvalue, &n->family, buffer, prefixlen); @@ -2580,7 +2580,7 @@ int config_parse_route_boolean( else if (streq(lvalue, "TTLPropagate")) n->ttl_propagate = r; else - assert_not_reached("Invalid lvalue"); + assert_not_reached(); TAKE_PTR(n); return 0; @@ -2814,7 +2814,7 @@ int config_parse_tcp_window( else if (streq(lvalue, "InitialAdvertisedReceiveWindow")) n->initrwnd = k; else - assert_not_reached("Invalid TCP window type."); + assert_not_reached(); TAKE_PTR(n); return 0; diff --git a/src/network/networkd-routing-policy-rule.c b/src/network/networkd-routing-policy-rule.c index af7e8a973c..abf71a06a0 100644 --- a/src/network/networkd-routing-policy-rule.c +++ b/src/network/networkd-routing-policy-rule.c @@ -1051,7 +1051,7 @@ int manager_rtnl_process_rule(sd_netlink *rtnl, sd_netlink_message *message, Man break; default: - assert_not_reached("Received invalid RTNL message type"); + assert_not_reached(); } return 1; @@ -1636,7 +1636,7 @@ static int routing_policy_rule_section_verify(RoutingPolicyRule *rule) { * update routing_policy_rule_is_created_by_kernel() when a new setting which sets the flag is * added in the future. */ if (rule->l3mdev > 0) - assert_not_reached("FRA_L3MDEV flag should not be configured."); + assert_not_reached(); return 0; } diff --git a/src/network/networkd-setlink.c b/src/network/networkd-setlink.c index a316a6c59b..8710518eba 100644 --- a/src/network/networkd-setlink.c +++ b/src/network/networkd-setlink.c @@ -460,7 +460,7 @@ static int link_configure( return log_link_debug_errno(link, r, "Could not append IFLA_MTU attribute: %m"); break; default: - assert_not_reached("Invalid set link operation"); + assert_not_reached(); } r = netlink_call_async(link->manager->rtnl, NULL, req, callback, @@ -998,7 +998,7 @@ int link_request_to_activate(Link *link) { up = false; break; default: - assert_not_reached("invalid activation policy"); + assert_not_reached(); } link->activated = false; diff --git a/src/network/networkd-sriov.c b/src/network/networkd-sriov.c index 7a76b61c4a..106560974e 100644 --- a/src/network/networkd-sriov.c +++ b/src/network/networkd-sriov.c @@ -309,7 +309,7 @@ int config_parse_sr_iov_uint32( else if (streq(lvalue, "QualityOfService")) sr_iov->qos = 0; else - assert_not_reached("Invalid lvalue"); + assert_not_reached(); TAKE_PTR(sr_iov); return 0; @@ -337,7 +337,7 @@ int config_parse_sr_iov_uint32( } else if (streq(lvalue, "QualityOfService")) sr_iov->qos = k; else - assert_not_reached("Invalid lvalue"); + assert_not_reached(); TAKE_PTR(sr_iov); return 0; @@ -467,7 +467,7 @@ int config_parse_sr_iov_boolean( else if (streq(lvalue, "Trust")) sr_iov->trust = -1; else - assert_not_reached("Invalid lvalue"); + assert_not_reached(); TAKE_PTR(sr_iov); return 0; @@ -486,7 +486,7 @@ int config_parse_sr_iov_boolean( else if (streq(lvalue, "Trust")) sr_iov->trust = r; else - assert_not_reached("Invalid lvalue"); + assert_not_reached(); TAKE_PTR(sr_iov); return 0; diff --git a/src/network/tc/codel.c b/src/network/tc/codel.c index 807c247b57..33f40d87d4 100644 --- a/src/network/tc/codel.c +++ b/src/network/tc/codel.c @@ -168,7 +168,7 @@ int config_parse_controlled_delay_usec( else if (streq(lvalue, "CEThresholdSec")) p = &cd->ce_threshold_usec; else - assert_not_reached("Invalid lvalue"); + assert_not_reached(); if (isempty(rvalue)) { if (streq(lvalue, "CEThresholdSec")) diff --git a/src/network/tc/ets.c b/src/network/tc/ets.c index 8214a575bf..f8dd1adabc 100644 --- a/src/network/tc/ets.c +++ b/src/network/tc/ets.c @@ -113,7 +113,7 @@ int config_parse_ets_u8( else if (streq(lvalue, "StrictBands")) p = &ets->n_strict; else - assert_not_reached("Invalid lvalue."); + assert_not_reached(); if (isempty(rvalue)) { *p = 0; diff --git a/src/network/tc/fifo.c b/src/network/tc/fifo.c index 3aa9573731..3dd7f0b5f4 100644 --- a/src/network/tc/fifo.c +++ b/src/network/tc/fifo.c @@ -30,7 +30,7 @@ static int fifo_fill_message(Link *link, QDisc *qdisc, sd_netlink_message *req) fifo = PFIFO_HEAD_DROP(qdisc); break; default: - assert_not_reached("Invalid QDisc kind."); + assert_not_reached(); } opt.limit = fifo->limit; @@ -81,7 +81,7 @@ int config_parse_pfifo_size( fifo = PFIFO_HEAD_DROP(qdisc); break; default: - assert_not_reached("Invalid QDisc kind."); + assert_not_reached(); } if (isempty(rvalue)) { diff --git a/src/network/tc/fq-codel.c b/src/network/tc/fq-codel.c index bcc734df90..7c61cf2ac6 100644 --- a/src/network/tc/fq-codel.c +++ b/src/network/tc/fq-codel.c @@ -133,7 +133,7 @@ int config_parse_fair_queueing_controlled_delay_u32( else if (streq(lvalue, "Flows")) p = &fqcd->flows; else - assert_not_reached("Invalid lvalue."); + assert_not_reached(); if (isempty(rvalue)) { *p = 0; @@ -196,7 +196,7 @@ int config_parse_fair_queueing_controlled_delay_usec( else if (streq(lvalue, "CEThresholdSec")) p = &fqcd->ce_threshold_usec; else - assert_not_reached("Invalid lvalue."); + assert_not_reached(); if (isempty(rvalue)) { if (streq(lvalue, "CEThresholdSec")) @@ -315,7 +315,7 @@ int config_parse_fair_queueing_controlled_delay_size( else if (STR_IN_SET(lvalue, "QuantumBytes", "Quantum")) p = &fqcd->quantum; else - assert_not_reached("Invalid lvalue."); + assert_not_reached(); if (isempty(rvalue)) { if (STR_IN_SET(lvalue, "MemoryLimitBytes", "MemoryLimit")) diff --git a/src/network/tc/fq.c b/src/network/tc/fq.c index d48aea86fb..d10a863495 100644 --- a/src/network/tc/fq.c +++ b/src/network/tc/fq.c @@ -145,7 +145,7 @@ int config_parse_fair_queueing_u32( else if (streq(lvalue, "OrphanMask")) p = &fq->orphan_mask; else - assert_not_reached("Invalid lvalue"); + assert_not_reached(); if (isempty(rvalue)) { *p = 0; @@ -207,7 +207,7 @@ int config_parse_fair_queueing_size( else if (STR_IN_SET(lvalue, "InitialQuantumBytes", "InitialQuantum")) p = &fq->initial_quantum; else - assert_not_reached("Invalid lvalue"); + assert_not_reached(); if (isempty(rvalue)) { *p = 0; diff --git a/src/network/tc/gred.c b/src/network/tc/gred.c index 04fcd59e48..ce26e62450 100644 --- a/src/network/tc/gred.c +++ b/src/network/tc/gred.c @@ -106,7 +106,7 @@ int config_parse_generic_random_early_detection_u32( else if (streq(lvalue, "DefaultVirtualQueue")) p = &gred->default_virtual_queue; else - assert_not_reached("Invalid lvalue."); + assert_not_reached(); if (isempty(rvalue)) { *p = 0; diff --git a/src/network/tc/htb.c b/src/network/tc/htb.c index 17455248a7..14fb1f92e3 100644 --- a/src/network/tc/htb.c +++ b/src/network/tc/htb.c @@ -338,7 +338,7 @@ int config_parse_hierarchy_token_bucket_class_size( else if (streq(lvalue, "CeilBufferBytes")) htb->ceil_buffer = 0; else - assert_not_reached("Invalid lvalue"); + assert_not_reached(); tclass = NULL; return 0; @@ -369,7 +369,7 @@ int config_parse_hierarchy_token_bucket_class_size( else if (streq(lvalue, "CeilBufferBytes")) htb->ceil_buffer = v; else - assert_not_reached("Invalid lvalue"); + assert_not_reached(); tclass = NULL; @@ -414,7 +414,7 @@ int config_parse_hierarchy_token_bucket_class_rate( else if (streq(lvalue, "CeilRate")) v = &htb->ceil_rate; else - assert_not_reached("Invalid lvalue"); + assert_not_reached(); if (isempty(rvalue)) { *v = 0; diff --git a/src/network/tc/tbf.c b/src/network/tc/tbf.c index 50d14a5356..1d1bc6f0e9 100644 --- a/src/network/tc/tbf.c +++ b/src/network/tc/tbf.c @@ -154,7 +154,7 @@ int config_parse_token_bucket_filter_size( else if (streq(lvalue, "MPUBytes")) tbf->mpu = 0; else - assert_not_reached("unknown lvalue"); + assert_not_reached(); TAKE_PTR(qdisc); return 0; @@ -177,7 +177,7 @@ int config_parse_token_bucket_filter_size( else if (streq(lvalue, "MTUBytes")) tbf->mtu = k; else - assert_not_reached("unknown lvalue"); + assert_not_reached(); TAKE_PTR(qdisc); @@ -222,7 +222,7 @@ int config_parse_token_bucket_filter_rate( else if (streq(lvalue, "PeakRate")) p = &tbf->peak_rate; else - assert_not_reached("unknown lvalue"); + assert_not_reached(); if (isempty(rvalue)) { *p = 0; diff --git a/src/network/tc/tc.c b/src/network/tc/tc.c index 0cd46cf633..a3cfed53fa 100644 --- a/src/network/tc/tc.c +++ b/src/network/tc/tc.c @@ -17,7 +17,7 @@ void traffic_control_free(TrafficControl *tc) { tclass_free(TC_TO_TCLASS(tc)); break; default: - assert_not_reached("Invalid traffic control type"); + assert_not_reached(); } } @@ -31,7 +31,7 @@ static int traffic_control_configure(Link *link, TrafficControl *tc) { case TC_KIND_TCLASS: return tclass_configure(link, TC_TO_TCLASS(tc)); default: - assert_not_reached("Invalid traffic control type"); + assert_not_reached(); } } @@ -72,7 +72,7 @@ static int traffic_control_section_verify(TrafficControl *tc, bool *qdisc_has_ro case TC_KIND_TCLASS: return tclass_section_verify(TC_TO_TCLASS(tc)); default: - assert_not_reached("Invalid traffic control type"); + assert_not_reached(); } } diff --git a/src/network/wait-online/wait-online.c b/src/network/wait-online/wait-online.c index 1b24b6f1a6..ad6f18bbd4 100644 --- a/src/network/wait-online/wait-online.c +++ b/src/network/wait-online/wait-online.c @@ -187,7 +187,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/notify/notify.c b/src/notify/notify.c index 99f54ceaaa..49d5f3ec92 100644 --- a/src/notify/notify.c +++ b/src/notify/notify.c @@ -170,7 +170,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } } diff --git a/src/nspawn/nspawn-mount.c b/src/nspawn/nspawn-mount.c index 60f956da0f..c59151685c 100644 --- a/src/nspawn/nspawn-mount.c +++ b/src/nspawn/nspawn-mount.c @@ -946,7 +946,7 @@ int mount_custom( break; default: - assert_not_reached("Unknown custom mount type"); + assert_not_reached(); } if (r < 0) diff --git a/src/nspawn/nspawn-stub-pid1.c b/src/nspawn/nspawn-stub-pid1.c index 3cbe4ef5a6..6dbd6ba4c9 100644 --- a/src/nspawn/nspawn-stub-pid1.c +++ b/src/nspawn/nspawn-stub-pid1.c @@ -180,7 +180,7 @@ int stub_pid1(sd_id128_t uuid) { state = STATE_REBOOT; else - assert_not_reached("Got unexpected signal"); + assert_not_reached(); r = kill_and_sigcont(pid, SIGTERM); diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 99a3256219..d75cce408e 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -1675,7 +1675,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (argc > optind) { @@ -2013,7 +2013,7 @@ static int setup_timezone(const char *dest) { break; default: - assert_not_reached("unexpected mode"); + assert_not_reached(); } /* Fix permissions of the symlink or file copy we just created */ diff --git a/src/oom/oomctl.c b/src/oom/oomctl.c index 0d215cf6e9..1836dc1014 100644 --- a/src/oom/oomctl.c +++ b/src/oom/oomctl.c @@ -110,7 +110,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Invalid option passed."); + assert_not_reached(); } return 1; diff --git a/src/oom/oomd.c b/src/oom/oomd.c index deb7b094d5..8d4014ee06 100644 --- a/src/oom/oomd.c +++ b/src/oom/oomd.c @@ -105,7 +105,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unknown option code."); + assert_not_reached(); } if (optind < argc) diff --git a/src/partition/growfs.c b/src/partition/growfs.c index 0497c6cfc6..af6a9ef600 100644 --- a/src/partition/growfs.c +++ b/src/partition/growfs.c @@ -180,7 +180,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (optind + 1 != argc) diff --git a/src/partition/repart.c b/src/partition/repart.c index 42a8260c2e..c75198e5c9 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -4347,7 +4347,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (argc - optind > 1) diff --git a/src/path/path.c b/src/path/path.c index aec75f1fb7..0024a60611 100644 --- a/src/path/path.c +++ b/src/path/path.c @@ -185,7 +185,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/portable/portable.c b/src/portable/portable.c index 5afb008bb8..ba7fd58fc1 100644 --- a/src/portable/portable.c +++ b/src/portable/portable.c @@ -481,7 +481,7 @@ static int portable_extract_by_path( assert(!os_release); os_release = TAKE_PTR(add); } else - assert_not_reached("Unexpected metadata item from child."); + assert_not_reached(); } r = wait_for_terminate_and_check("(sd-dissect)", child, 0); diff --git a/src/portable/portablectl.c b/src/portable/portablectl.c index 2d8079ad97..c2d79ec3a2 100644 --- a/src/portable/portablectl.c +++ b/src/portable/portablectl.c @@ -1288,7 +1288,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } } diff --git a/src/resolve/resolvconf-compat.c b/src/resolve/resolvconf-compat.c index 93ded6d564..4fdf445c98 100644 --- a/src/resolve/resolvconf-compat.c +++ b/src/resolve/resolvconf-compat.c @@ -200,7 +200,7 @@ int resolvconf_parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (arg_mode == _MODE_INVALID) diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c index e9fb8b32fc..196dccdba0 100644 --- a/src/resolve/resolvectl.c +++ b/src/resolve/resolvectl.c @@ -3009,7 +3009,7 @@ static int compat_parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (arg_type == 0 && arg_class != 0) @@ -3261,7 +3261,7 @@ static int native_parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (arg_type == 0 && arg_class != 0) @@ -3411,7 +3411,7 @@ static int compat_main(int argc, char *argv[], sd_bus *bus) { return translate("revert", arg_ifname, 0, NULL, bus); case _MODE_INVALID: - assert_not_reached("invalid mode"); + assert_not_reached(); } return 0; diff --git a/src/resolve/resolved-bus.c b/src/resolve/resolved-bus.c index 7226200f00..8ad50ba29b 100644 --- a/src/resolve/resolved-bus.c +++ b/src/resolve/resolved-bus.c @@ -135,7 +135,7 @@ static int reply_query_state(DnsQuery *q) { case DNS_TRANSACTION_VALIDATING: case DNS_TRANSACTION_SUCCESS: default: - assert_not_reached("Impossible state"); + assert_not_reached(); } } diff --git a/src/resolve/resolved-conf.c b/src/resolve/resolved-conf.c index 283c06345c..3afaaad937 100644 --- a/src/resolve/resolved-conf.c +++ b/src/resolve/resolved-conf.c @@ -395,7 +395,7 @@ int config_parse_dnssd_txt( break; default: - assert_not_reached("Unknown type of Txt config"); + assert_not_reached(); } LIST_INSERT_AFTER(items, txt_data->txt, last, i); diff --git a/src/resolve/resolved-dns-dnssec.c b/src/resolve/resolved-dns-dnssec.c index 91da5b6515..fd7679f17d 100644 --- a/src/resolve/resolved-dns-dnssec.c +++ b/src/resolve/resolved-dns-dnssec.c @@ -1028,7 +1028,7 @@ int dnssec_verify_rrset_search( continue; default: - assert_not_reached("Unexpected DNSSEC validation result"); + assert_not_reached(); } } } diff --git a/src/resolve/resolved-dns-packet.h b/src/resolve/resolved-dns-packet.h index 6e7175c754..0b797ecb1a 100644 --- a/src/resolve/resolved-dns-packet.h +++ b/src/resolve/resolved-dns-packet.h @@ -332,7 +332,7 @@ static inline size_t udp_header_size(int af) { case AF_INET6: return UDP6_PACKET_HEADER_SIZE; default: - assert_not_reached("Unexpected address family"); + assert_not_reached(); } } diff --git a/src/resolve/resolved-dns-scope.c b/src/resolve/resolved-dns-scope.c index 178482727c..26a3006a6c 100644 --- a/src/resolve/resolved-dns-scope.c +++ b/src/resolve/resolved-dns-scope.c @@ -757,7 +757,7 @@ DnsScopeMatch dns_scope_good_domain( } default: - assert_not_reached("Unknown scope protocol"); + assert_not_reached(); } } diff --git a/src/resolve/resolved-dns-search-domain.c b/src/resolve/resolved-dns-search-domain.c index 94a46570f2..c9f148a2b9 100644 --- a/src/resolve/resolved-dns-search-domain.c +++ b/src/resolve/resolved-dns-search-domain.c @@ -58,7 +58,7 @@ int dns_search_domain_new( break; default: - assert_not_reached("Unknown search domain type"); + assert_not_reached(); } d->linked = true; @@ -135,7 +135,7 @@ void dns_search_domain_move_back_and_unmark(DnsSearchDomain *d) { break; default: - assert_not_reached("Unknown search domain type"); + assert_not_reached(); } } diff --git a/src/resolve/resolved-dns-server.c b/src/resolve/resolved-dns-server.c index e7a4bce71a..04a8e92d73 100644 --- a/src/resolve/resolved-dns-server.c +++ b/src/resolve/resolved-dns-server.c @@ -90,7 +90,7 @@ int dns_server_new( break; default: - assert_not_reached("Unknown server type"); + assert_not_reached(); } s->linked = true; @@ -158,7 +158,7 @@ void dns_server_unlink(DnsServer *s) { s->manager->n_dns_servers--; break; default: - assert_not_reached("Unknown server type"); + assert_not_reached(); } s->linked = false; @@ -213,7 +213,7 @@ void dns_server_move_back_and_unmark(DnsServer *s) { break; default: - assert_not_reached("Unknown server type"); + assert_not_reached(); } } diff --git a/src/resolve/resolved-dns-stub.c b/src/resolve/resolved-dns-stub.c index 5b9d32f001..cec2c24151 100644 --- a/src/resolve/resolved-dns-stub.c +++ b/src/resolve/resolved-dns-stub.c @@ -813,7 +813,7 @@ static void dns_stub_query_complete(DnsQuery *q) { case DNS_TRANSACTION_PENDING: case DNS_TRANSACTION_VALIDATING: default: - assert_not_reached("Impossible state"); + assert_not_reached(); } dns_query_free(q); diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c index 9535a7ba4c..c2ca181ab7 100644 --- a/src/resolve/resolved-dns-transaction.c +++ b/src/resolve/resolved-dns-transaction.c @@ -1091,7 +1091,7 @@ void dns_transaction_process_reply(DnsTransaction *t, DnsPacket *p, bool encrypt break; default: - assert_not_reached("Invalid DNS protocol."); + assert_not_reached(); } if (t->received != p) { @@ -1184,7 +1184,7 @@ void dns_transaction_process_reply(DnsTransaction *t, DnsPacket *p, bool encrypt break; default: - assert_not_reached("Invalid DNS protocol."); + assert_not_reached(); } if (DNS_PACKET_TC(p)) { @@ -1528,7 +1528,7 @@ static int on_transaction_timeout(sd_event_source *s, usec_t usec, void *userdat break; default: - assert_not_reached("Invalid DNS protocol."); + assert_not_reached(); } log_debug("Timeout reached on transaction %" PRIu16 ".", t->id); @@ -1567,7 +1567,7 @@ static usec_t transaction_get_resend_timeout(DnsTransaction *t) { return t->scope->resend_timeout; default: - assert_not_reached("Invalid DNS protocol."); + assert_not_reached(); } } @@ -1959,7 +1959,7 @@ int dns_transaction_go(DnsTransaction *t) { accuracy = MDNS_JITTER_RANGE_USEC; break; default: - assert_not_reached("bad protocol"); + assert_not_reached(); } assert(!t->timeout_event_source); @@ -3530,7 +3530,7 @@ int dns_transaction_validate_dnssec(DnsTransaction *t) { break; default: - assert_not_reached("Unexpected NSEC result."); + assert_not_reached(); } } diff --git a/src/resolve/resolved-varlink.c b/src/resolve/resolved-varlink.c index 27d8c8967e..4a26f6b9fe 100644 --- a/src/resolve/resolved-varlink.c +++ b/src/resolve/resolved-varlink.c @@ -78,7 +78,7 @@ static int reply_query_state(DnsQuery *q) { case DNS_TRANSACTION_VALIDATING: case DNS_TRANSACTION_SUCCESS: default: - assert_not_reached("Impossible state"); + assert_not_reached(); } } diff --git a/src/run/run.c b/src/run/run.c index 344c8f6641..0be974f03a 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -503,7 +503,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } with_trigger = !!arg_path_property || !!arg_socket_property || arg_with_timer; @@ -1155,7 +1155,7 @@ static int start_transient_service( if (!pty_path) return log_oom(); } else - assert_not_reached("Can't allocate tty via ssh"); + assert_not_reached(); } /* Optionally, wait for the start job to complete. If we are supposed to read the service's stdin @@ -1628,7 +1628,7 @@ static int start_transient_trigger( else if (streq(suffix, ".timer")) r = transient_timer_set_properties(m); else - assert_not_reached("Invalid suffix"); + assert_not_reached(); if (r < 0) return r; diff --git a/src/shared/acl-util.c b/src/shared/acl-util.c index 10e1857649..3f286a888b 100644 --- a/src/shared/acl-util.c +++ b/src/shared/acl-util.c @@ -320,7 +320,7 @@ static int acl_entry_equal(acl_entry_t a, acl_entry_t b) { return *gid_a == *gid_b; } default: - assert_not_reached("Unknown acl tag type"); + assert_not_reached(); } } diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index 64ca67993c..942a59be88 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -291,7 +291,7 @@ int bus_connect_transport( break; default: - assert_not_reached("Hmm, unknown transport type."); + assert_not_reached(); } if (r < 0) return r; @@ -337,7 +337,7 @@ int bus_connect_transport_systemd(BusTransport transport, const char *host, bool break; default: - assert_not_reached("Hmm, unknown transport type."); + assert_not_reached(); } return r; diff --git a/src/shared/condition.c b/src/shared/condition.c index ec9d57b292..1d28f7ba57 100644 --- a/src/shared/condition.c +++ b/src/shared/condition.c @@ -202,7 +202,7 @@ static bool test_order(int k, OrderOperator p) { return k > 0; default: - assert_not_reached("unknown order"); + assert_not_reached(); } } diff --git a/src/shared/format-table.c b/src/shared/format-table.c index 6dca6661e1..c2bde30131 100644 --- a/src/shared/format-table.c +++ b/src/shared/format-table.c @@ -316,7 +316,7 @@ static size_t table_data_size(TableDataType type, const void *data) { return sizeof(mode_t); default: - assert_not_reached("Uh? Unexpected cell type"); + assert_not_reached(); } } @@ -1048,7 +1048,7 @@ int table_add_many_internal(Table *t, TableDataType first_type, ...) { return 0; default: - assert_not_reached("Uh? Unexpected data type."); + assert_not_reached(); } r = table_add_cell(t, &last_cell, type, data); @@ -1778,7 +1778,7 @@ static const char *table_data_format(Table *t, TableData *d, bool avoid_uppercas } default: - assert_not_reached("Unexpected type?"); + assert_not_reached(); } return d->formatted; diff --git a/src/shared/install.c b/src/shared/install.c index 4bf868f8e9..a348f0c572 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -2897,7 +2897,7 @@ int unit_file_lookup_state( break; default: - assert_not_reached("Unexpected unit file type."); + assert_not_reached(); } *ret = state; @@ -2989,7 +2989,7 @@ static int presets_find_config(UnitFileScope scope, const char *root_dir, char * else if (IN_SET(scope, UNIT_FILE_GLOBAL, UNIT_FILE_USER)) dirs = user_dirs; else - assert_not_reached("Invalid unit file scope"); + assert_not_reached(); return conf_files_list_strv(files, ".preset", root_dir, 0, dirs); } @@ -3173,7 +3173,7 @@ static int query_presets(const char *name, const UnitFilePresets *presets, char log_debug("Preset files say disable %s.", name); return 0; default: - assert_not_reached("invalid preset action"); + assert_not_reached(); } } diff --git a/src/shared/journal-importer.c b/src/shared/journal-importer.c index 9e11dc09c1..bbb152481e 100644 --- a/src/shared/journal-importer.c +++ b/src/shared/journal-importer.c @@ -417,7 +417,7 @@ int journal_importer_process_data(JournalImporter *imp) { return 0; /* continue */ default: - assert_not_reached("wtf?"); + assert_not_reached(); } } diff --git a/src/shared/json.c b/src/shared/json.c index c52460a3ec..ea37728dc5 100644 --- a/src/shared/json.c +++ b/src/shared/json.c @@ -505,7 +505,7 @@ static void json_variant_set(JsonVariant *a, JsonVariant *b) { break; default: - assert_not_reached("Unexpected variant type"); + assert_not_reached(); } } @@ -763,7 +763,7 @@ static size_t json_variant_size(JsonVariant* v) { return offsetof(JsonVariant, value); default: - assert_not_reached("unexpected type"); + assert_not_reached(); } } @@ -1397,7 +1397,7 @@ bool json_variant_equal(JsonVariant *a, JsonVariant *b) { } default: - assert_not_reached("Unknown variant type."); + assert_not_reached(); } } @@ -1749,7 +1749,7 @@ static int json_format(FILE *f, JsonVariant *v, JsonFormatFlags flags, const cha } default: - assert_not_reached("Unexpected variant type."); + assert_not_reached(); } return 0; @@ -2787,7 +2787,7 @@ int json_tokenize( return -EINVAL; default: - assert_not_reached("Unexpected tokenizer state"); + assert_not_reached(); } null_return: @@ -3156,7 +3156,7 @@ static int json_parse_internal( break; default: - assert_not_reached("Unexpected token"); + assert_not_reached(); } if (add) { diff --git a/src/shared/local-addresses.c b/src/shared/local-addresses.c index bd69e946f5..d1f6b5df03 100644 --- a/src/shared/local-addresses.c +++ b/src/shared/local-addresses.c @@ -422,7 +422,7 @@ int local_outbounds( break; default: - assert_not_reached("Unexpected protocol"); + assert_not_reached(); } /* So ideally we'd just use IP_UNICAST_IF here to pass the ifindex info to the kernel before @@ -493,7 +493,7 @@ int local_outbounds( break; default: - assert_not_reached("Unexpected protocol"); + assert_not_reached(); } } diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c index 3165cf29da..afce8e8fe3 100644 --- a/src/shared/logs-show.c +++ b/src/shared/logs-show.c @@ -416,7 +416,7 @@ static int output_timestamp_realtime(FILE *f, sd_journal *j, OutputMode mode, Ou break; default: - assert_not_reached("Unknown time format"); + assert_not_reached(); } } diff --git a/src/shared/service-util.c b/src/shared/service-util.c index 092be6ee7f..99b1108b77 100644 --- a/src/shared/service-util.c +++ b/src/shared/service-util.c @@ -76,7 +76,7 @@ int service_parse_argv( return -EINVAL; default: - assert_not_reached("Unknown option code."); + assert_not_reached(); } if (optind < argc) diff --git a/src/shared/socket-netlink.c b/src/shared/socket-netlink.c index 0c04437826..494047a5d1 100644 --- a/src/shared/socket-netlink.c +++ b/src/shared/socket-netlink.c @@ -129,7 +129,7 @@ int socket_address_parse(SocketAddress *a, const char *s) { .size = sizeof(struct sockaddr_in6), }; else - assert_not_reached("Family quarrel"); + assert_not_reached(); } } diff --git a/src/shared/tests.c b/src/shared/tests.c index ab7d799029..175b6d5499 100644 --- a/src/shared/tests.c +++ b/src/shared/tests.c @@ -160,7 +160,7 @@ bool have_namespaces(void) { if (si.si_status == EXIT_FAILURE) return false; - assert_not_reached("unexpected exit code"); + assert_not_reached(); } bool can_memlock(void) { diff --git a/src/shared/userdb.c b/src/shared/userdb.c index 91ac7c3832..555c71c82d 100644 --- a/src/shared/userdb.c +++ b/src/shared/userdb.c @@ -90,7 +90,7 @@ UserDBIterator* userdb_iterator_free(UserDBIterator *iterator) { break; default: - assert_not_reached("Unexpected state?"); + assert_not_reached(); } sd_event_unref(iterator->event); @@ -333,7 +333,7 @@ static int userdb_on_query_reply( } default: - assert_not_reached("unexpected lookup"); + assert_not_reached(); } finish: diff --git a/src/shared/varlink.c b/src/shared/varlink.c index 4033947d3b..07a1b96f60 100644 --- a/src/shared/varlink.c +++ b/src/shared/varlink.c @@ -905,7 +905,7 @@ static int varlink_dispatch_method(Varlink *v) { break; default: - assert_not_reached("Unexpected state"); + assert_not_reached(); } @@ -1521,7 +1521,7 @@ int varlink_call( return varlink_log_errno(v, SYNTHETIC_ERRNO(ETIME), "Connection timed out."); default: - assert_not_reached("Unexpected state after method call."); + assert_not_reached(); } } diff --git a/src/shared/xml.c b/src/shared/xml.c index 8ff3feafe4..df381d85b8 100644 --- a/src/shared/xml.c +++ b/src/shared/xml.c @@ -233,5 +233,5 @@ int xml_tokenize(const char **p, char **name, void **state, unsigned *line) { } - assert_not_reached("Bad state"); + assert_not_reached(); } diff --git a/src/shutdown/shutdown.c b/src/shutdown/shutdown.c index a98cfc4d8a..2ba1a21dae 100644 --- a/src/shutdown/shutdown.c +++ b/src/shutdown/shutdown.c @@ -149,7 +149,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option code."); + assert_not_reached(); } if (!arg_verb) @@ -610,7 +610,7 @@ int main(int argc, char *argv[]) { break; default: - assert_not_reached("Unknown magic"); + assert_not_reached(); } (void) reboot(cmd); diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c index 19c99db1b4..7064f3a905 100644 --- a/src/sleep/sleep.c +++ b/src/sleep/sleep.c @@ -365,7 +365,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (argc - optind != 1) diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c index 6e3ee0d76b..be0be91f3e 100644 --- a/src/socket-proxy/socket-proxyd.c +++ b/src/socket-proxy/socket-proxyd.c @@ -657,7 +657,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (optind >= argc) diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c index 458a91be29..8c452854b1 100644 --- a/src/sysctl/sysctl.c +++ b/src/sysctl/sysctl.c @@ -369,7 +369,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (arg_cat_config && argc > optind) diff --git a/src/sysext/sysext.c b/src/sysext/sysext.c index 572e4007fe..1e9279d612 100644 --- a/src/sysext/sysext.c +++ b/src/sysext/sysext.c @@ -566,7 +566,7 @@ static int merge_subprocess(Hashmap *images, const char *workspace) { break; } default: - assert_not_reached("Unsupported image type"); + assert_not_reached(); } r = validate_version( @@ -957,7 +957,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/systemctl/systemctl-add-dependency.c b/src/systemctl/systemctl-add-dependency.c index 2a0290de7f..ba385ea2a2 100644 --- a/src/systemctl/systemctl-add-dependency.c +++ b/src/systemctl/systemctl-add-dependency.c @@ -34,7 +34,7 @@ int add_dependency(int argc, char *argv[], void *userdata) { else if (streq(verb, "add-requires")) dep = UNIT_REQUIRES; else - assert_not_reached("Unknown verb"); + assert_not_reached(); if (install_client_side()) { r = unit_file_add_dependency(arg_scope, unit_file_flags_from_args(), arg_root, names, target, dep, &changes, &n_changes); diff --git a/src/systemctl/systemctl-clean-or-freeze.c b/src/systemctl/systemctl-clean-or-freeze.c index eca3a6d354..fb4d643517 100644 --- a/src/systemctl/systemctl-clean-or-freeze.c +++ b/src/systemctl/systemctl-clean-or-freeze.c @@ -44,7 +44,7 @@ int clean_or_freeze_unit(int argc, char *argv[], void *userdata) { else if (streq(argv[0], "thaw")) method = "ThawUnit"; else - assert_not_reached("Unhandled method"); + assert_not_reached(); STRV_FOREACH(name, names) { _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; diff --git a/src/systemctl/systemctl-compat-halt.c b/src/systemctl/systemctl-compat-halt.c index 51a89ae4a7..760758322f 100644 --- a/src/systemctl/systemctl-compat-halt.c +++ b/src/systemctl/systemctl-compat-halt.c @@ -127,7 +127,7 @@ int halt_parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (arg_action == ACTION_REBOOT && (argc == optind || argc == optind + 1)) { diff --git a/src/systemctl/systemctl-compat-runlevel.c b/src/systemctl/systemctl-compat-runlevel.c index ad6325bf35..04b6b7630b 100644 --- a/src/systemctl/systemctl-compat-runlevel.c +++ b/src/systemctl/systemctl-compat-runlevel.c @@ -55,7 +55,7 @@ int runlevel_parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (optind < argc) diff --git a/src/systemctl/systemctl-compat-shutdown.c b/src/systemctl/systemctl-compat-shutdown.c index 11154f5f8b..5e613e2aa2 100644 --- a/src/systemctl/systemctl-compat-shutdown.c +++ b/src/systemctl/systemctl-compat-shutdown.c @@ -112,7 +112,7 @@ int shutdown_parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (argc > optind && arg_action != ACTION_CANCEL_SHUTDOWN) { diff --git a/src/systemctl/systemctl-compat-telinit.c b/src/systemctl/systemctl-compat-telinit.c index f0e9ca8d79..c81e9bc3ce 100644 --- a/src/systemctl/systemctl-compat-telinit.c +++ b/src/systemctl/systemctl-compat-telinit.c @@ -93,7 +93,7 @@ int telinit_parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (optind >= argc) diff --git a/src/systemctl/systemctl-daemon-reload.c b/src/systemctl/systemctl-daemon-reload.c index 03ba908383..1c23315337 100644 --- a/src/systemctl/systemctl-daemon-reload.c +++ b/src/systemctl/systemctl-daemon-reload.c @@ -35,7 +35,7 @@ int daemon_reload(int argc, char *argv[], void *userdata) { break; default: - assert_not_reached("Unexpected action"); + assert_not_reached(); } r = bus_message_new_method_call(bus, &m, bus_systemd_mgr, method); diff --git a/src/systemctl/systemctl-enable.c b/src/systemctl/systemctl-enable.c index 8f053ca649..dcbe2c7302 100644 --- a/src/systemctl/systemctl-enable.c +++ b/src/systemctl/systemctl-enable.c @@ -124,7 +124,7 @@ int enable_unit(int argc, char *argv[], void *userdata) { else if (streq(verb, "revert")) r = unit_file_revert(arg_scope, arg_root, names, &changes, &n_changes); else - assert_not_reached("Unknown verb"); + assert_not_reached(); unit_file_dump_changes(r, verb, changes, n_changes, arg_quiet); if (r < 0) @@ -191,7 +191,7 @@ int enable_unit(int argc, char *argv[], void *userdata) { method = "RevertUnitFiles"; send_runtime = send_force = false; } else - assert_not_reached("Unknown verb"); + assert_not_reached(); r = bus_message_new_method_call(bus, &m, bus_systemd_mgr, method); if (r < 0) diff --git a/src/systemctl/systemctl-util.c b/src/systemctl/systemctl-util.c index 99f1394bcf..9f3174d106 100644 --- a/src/systemctl/systemctl-util.c +++ b/src/systemctl/systemctl-util.c @@ -930,6 +930,6 @@ int halt_now(enum action a) { (arg_dry_run ? REBOOT_DRY_RUN : 0)); default: - assert_not_reached("Unknown action."); + assert_not_reached(); } } diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 4cc723aab5..f5ecc1f60f 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -922,7 +922,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (arg_transport == BUS_TRANSPORT_REMOTE && arg_scope != UNIT_FILE_SYSTEM) @@ -1184,7 +1184,7 @@ static int run(int argc, char *argv[]) { case _ACTION_INVALID: default: - assert_not_reached("Unknown action"); + assert_not_reached(); } finish: diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c index a18634d254..7daebdbe55 100644 --- a/src/sysusers/sysusers.c +++ b/src/sysusers/sysusers.c @@ -1345,7 +1345,7 @@ static int process_item(Item *i) { return add_group(i); default: - assert_not_reached("Unknown item type"); + assert_not_reached(); } } @@ -1917,7 +1917,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (arg_replace && arg_cat_config) diff --git a/src/test/test-bitmap.c b/src/test/test-bitmap.c index 42922a3500..655b823c7f 100644 --- a/src/test/test-bitmap.c +++ b/src/test/test-bitmap.c @@ -46,7 +46,7 @@ int main(int argc, const char *argv[]) { bitmap_unset(b, 32); BITMAP_FOREACH(n, NULL) - assert_not_reached("NULL bitmap"); + assert_not_reached(); assert_se(bitmap_set(b, 0) == 0); assert_se(bitmap_set(b, 1) == 0); diff --git a/src/test/test-chase-symlinks.c b/src/test/test-chase-symlinks.c index 892f8a073f..635c44675b 100644 --- a/src/test/test-chase-symlinks.c +++ b/src/test/test-chase-symlinks.c @@ -72,7 +72,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (optind == argc) diff --git a/src/test/test-install-root.c b/src/test/test-install-root.c index 50ed23a4ee..30494f7fa1 100644 --- a/src/test/test-install-root.c +++ b/src/test/test-install-root.c @@ -284,7 +284,7 @@ static void test_linked_units(const char *root) { else if (q && streq(changes[i].path, q)) q = NULL; else - assert_not_reached("wut?"); + assert_not_reached(); } assert(!p && !q); unit_file_changes_free(changes, n_changes); @@ -305,7 +305,7 @@ static void test_linked_units(const char *root) { else if (q && streq(changes[i].path, q)) q = NULL; else - assert_not_reached("wut?"); + assert_not_reached(); } assert(!p && !q); unit_file_changes_free(changes, n_changes); @@ -326,7 +326,7 @@ static void test_linked_units(const char *root) { else if (q && streq(changes[i].path, q)) q = NULL; else - assert_not_reached("wut?"); + assert_not_reached(); } assert(!p && !q); unit_file_changes_free(changes, n_changes); diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c index 4c041cd57f..ceea7a62f5 100644 --- a/src/test/test-path-util.c +++ b/src/test/test-path-util.c @@ -348,7 +348,7 @@ static void test_prefixes(void) { assert_se(values[i] == NULL); PATH_FOREACH_PREFIX(s, "////") - assert_not_reached("Wut?"); + assert_not_reached(); b = false; PATH_FOREACH_PREFIX_MORE(s, "////") { @@ -359,7 +359,7 @@ static void test_prefixes(void) { assert_se(b); PATH_FOREACH_PREFIX(s, "") - assert_not_reached("wut?"); + assert_not_reached(); b = false; PATH_FOREACH_PREFIX_MORE(s, "") { diff --git a/src/test/test-proc-cmdline.c b/src/test/test-proc-cmdline.c index 1f5ee7d768..a72523bd02 100644 --- a/src/test/test-proc-cmdline.c +++ b/src/test/test-proc-cmdline.c @@ -82,7 +82,7 @@ static int parse_item_given(const char *key, const char *value, void *data) { else if (in_initrd() && !*strip && proc_cmdline_key_streq(key, "rd.zumm")) assert_se(!value); else - assert_not_reached("Bad key!"); + assert_not_reached(); return 0; } diff --git a/src/test/test-strv.c b/src/test/test-strv.c index 134525288f..88ff35fc5a 100644 --- a/src/test/test-strv.c +++ b/src/test/test-strv.c @@ -640,10 +640,10 @@ static void test_strv_foreach_backwards(void) { assert_se(streq_ptr(*check, input_table_multiple[i--])); STRV_FOREACH_BACKWARDS(check, (char**) NULL) - assert_not_reached("Let's see that we check empty strv right, too."); + assert_not_reached(); STRV_FOREACH_BACKWARDS(check, (char**) { NULL }) - assert_not_reached("Let's see that we check empty strv right, too."); + assert_not_reached(); } static void test_strv_foreach_pair(void) { diff --git a/src/test/test-util.c b/src/test/test-util.c index fa36f54fcb..4d9008ba33 100644 --- a/src/test/test-util.c +++ b/src/test/test-util.c @@ -431,7 +431,7 @@ static void test_foreach_pointer(void) { break; default: - assert_not_reached("unexpected index"); + assert_not_reached(); break; } @@ -480,7 +480,7 @@ static void test_foreach_pointer(void) { break; default: - assert_not_reached("unexpected index"); + assert_not_reached(); break; } diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c index c0575c0323..6a4bbdbb48 100644 --- a/src/timedate/timedatectl.c +++ b/src/timedate/timedatectl.c @@ -999,7 +999,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; diff --git a/src/timesync/timesyncd-server.c b/src/timesync/timesyncd-server.c index f7ec317f41..79dfd47266 100644 --- a/src/timesync/timesyncd-server.c +++ b/src/timesync/timesyncd-server.c @@ -79,7 +79,7 @@ int server_name_new( LIST_FIND_TAIL(names, m->fallback_servers, tail); LIST_INSERT_AFTER(names, m->fallback_servers, tail, n); } else - assert_not_reached("Unknown server type"); + assert_not_reached(); n->manager = m; @@ -110,7 +110,7 @@ ServerName *server_name_free(ServerName *n) { else if (n->type == SERVER_FALLBACK) LIST_REMOVE(names, n->manager->fallback_servers, n); else - assert_not_reached("Unknown server type"); + assert_not_reached(); if (n->manager->current_server_name == n) manager_set_server_name(n->manager, NULL); diff --git a/src/tmpfiles/test-offline-passwd.c b/src/tmpfiles/test-offline-passwd.c index 1a961d125b..e509c63961 100644 --- a/src/tmpfiles/test-offline-passwd.c +++ b/src/tmpfiles/test-offline-passwd.c @@ -60,7 +60,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 0; diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index fb90f6bfbb..dd05dd9b4e 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -2447,7 +2447,7 @@ static int remove_item_instance(Item *i, const char *instance) { break; default: - assert_not_reached("wut?"); + assert_not_reached(); } return 0; @@ -3505,7 +3505,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (arg_operation == 0 && !arg_cat_config) @@ -3853,7 +3853,7 @@ static int run(int argc, char *argv[]) { else if (phase == PHASE_CREATE) op = arg_operation & OPERATION_CREATE; else - assert_not_reached("unexpected phase"); + assert_not_reached(); if (op == 0) /* Nothing requested in this phase */ continue; diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c index 59b144972b..7699bad9e0 100644 --- a/src/tty-ask-password-agent/tty-ask-password-agent.c +++ b/src/tty-ask-password-agent/tty-ask-password-agent.c @@ -508,7 +508,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } if (optind != argc) diff --git a/src/udev/cdrom_id/cdrom_id.c b/src/udev/cdrom_id/cdrom_id.c index df0ee6a3bb..a2185350d3 100644 --- a/src/udev/cdrom_id/cdrom_id.c +++ b/src/udev/cdrom_id/cdrom_id.c @@ -943,7 +943,7 @@ static int parse_argv(int argc, char *argv[]) { case 'h': return help(); default: - assert_not_reached("Unknown option"); + assert_not_reached(); } arg_node = argv[optind]; diff --git a/src/udev/dmi_memory_id/dmi_memory_id.c b/src/udev/dmi_memory_id/dmi_memory_id.c index 64eba0d314..4c0ec2eccb 100644 --- a/src/udev/dmi_memory_id/dmi_memory_id.c +++ b/src/udev/dmi_memory_id/dmi_memory_id.c @@ -665,7 +665,7 @@ static int parse_argv(int argc, char * const *argv) { case '?': return -EINVAL; default: - assert_not_reached("Unknown option"); + assert_not_reached(); } return 1; diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index 8dfe23691b..fa43548280 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -501,7 +501,7 @@ static int link_config_generate_new_name(const LinkConfigContext *ctx, const Lin (void) sd_device_get_property_value(device, "ID_NET_NAME_MAC", &new_name); break; default: - assert_not_reached("invalid policy"); + assert_not_reached(); } if (ifname_valid(new_name)) { log_device_debug(device, "Policy *%s* yields \"%s\".", name_policy_to_string(policy), new_name); @@ -569,7 +569,7 @@ static int link_config_apply_alternative_names(sd_netlink **rtnl, const LinkConf (void) sd_device_get_property_value(device, "ID_NET_NAME_MAC", &n); break; default: - assert_not_reached("invalid policy"); + assert_not_reached(); } if (!isempty(n)) { r = strv_extend(&altnames, n); diff --git a/src/udev/scsi_id/scsi_id.c b/src/udev/scsi_id/scsi_id.c index b2d8154d86..8ce73d03da 100644 --- a/src/udev/scsi_id/scsi_id.c +++ b/src/udev/scsi_id/scsi_id.c @@ -306,7 +306,7 @@ static int set_options(int argc, char **argv, return -1; default: - assert_not_reached("Unknown option"); + assert_not_reached(); } if (optind < argc && !dev_specified) { diff --git a/src/udev/test-udev-event.c b/src/udev/test-udev-event.c index fd1752c65f..b1a631dea2 100644 --- a/src/udev/test-udev-event.c +++ b/src/udev/test-udev-event.c @@ -83,7 +83,7 @@ int main(int argc, char *argv[]) { else if (streq(argv[1], "test2")) test2(); else - assert_not_reached("unknown command."); + assert_not_reached(); return 0; } diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index d269345259..2179c8d254 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -429,7 +429,7 @@ static ssize_t udev_event_subst_format( strpcpy(&s, l, val); break; default: - assert_not_reached("Unknown format substitution type"); + assert_not_reached(); } return s - dest; diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index bf997fc0ed..d050134aef 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -1374,7 +1374,7 @@ static bool token_match_string(UdevRuleToken *token, const char *str) { } break; default: - assert_not_reached("Invalid match type"); + assert_not_reached(); } return token->op == (match ? OP_MATCH : OP_NOMATCH); @@ -1405,7 +1405,7 @@ static bool token_match_attr(UdevRuleToken *token, sd_device *dev, UdevEvent *ev value = vbuf; break; default: - assert_not_reached("Invalid attribute substitution type"); + assert_not_reached(); } /* remove trailing whitespace, if not asked to match for it */ @@ -1607,7 +1607,7 @@ static int udev_rule_apply_token_to_event( else if (streq(k, "virt")) val = virtualization_to_string(detect_virtualization()); else - assert_not_reached("Invalid CONST key"); + assert_not_reached(); return token_match_string(token, val); } case TK_M_TAG: @@ -2233,7 +2233,7 @@ static int udev_rule_apply_token_to_event( /* do nothing for events. */ break; default: - assert_not_reached("Invalid token type"); + assert_not_reached(); } return true; diff --git a/src/udev/udevadm-control.c b/src/udev/udevadm-control.c index 437ac9b832..20820dd647 100644 --- a/src/udev/udevadm-control.c +++ b/src/udev/udevadm-control.c @@ -171,7 +171,7 @@ int control_main(int argc, char *argv[], void *userdata) { case '?': return -EINVAL; default: - assert_not_reached("Unknown option."); + assert_not_reached(); } if (optind < argc) diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c index 9414269fb8..e9db2847cf 100644 --- a/src/udev/udevadm-hwdb.c +++ b/src/udev/udevadm-hwdb.c @@ -71,7 +71,7 @@ static int parse_argv(int argc, char *argv[]) { case '?': return -EINVAL; default: - assert_not_reached("Unknown option"); + assert_not_reached(); } return 1; diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c index fa7f04f14c..1ea89c16cc 100644 --- a/src/udev/udevadm-info.c +++ b/src/udev/udevadm-info.c @@ -328,7 +328,7 @@ static int query_device(QueryType query, sd_device* device) { return print_record(device); } - assert_not_reached("unknown query type"); + assert_not_reached(); return 0; } @@ -456,7 +456,7 @@ int info_main(int argc, char *argv[], void *userdata) { case '?': return -EINVAL; default: - assert_not_reached("Unknown option"); + assert_not_reached(); } if (action == ACTION_DEVICE_ID_FILE) { @@ -508,7 +508,7 @@ int info_main(int argc, char *argv[], void *userdata) { else if (action == ACTION_ATTRIBUTE_WALK) r = print_device_chain(device); else - assert_not_reached("Unknown action"); + assert_not_reached(); if (r < 0) return r; } diff --git a/src/udev/udevadm-monitor.c b/src/udev/udevadm-monitor.c index 00b03c550d..76aaf7c42e 100644 --- a/src/udev/udevadm-monitor.c +++ b/src/udev/udevadm-monitor.c @@ -179,7 +179,7 @@ static int parse_argv(int argc, char *argv[]) { case '?': return -EINVAL; default: - assert_not_reached("Unknown option."); + assert_not_reached(); } if (!arg_print_kernel && !arg_print_udev) { diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c index 2c61c2d8b0..84b4f9ca45 100644 --- a/src/udev/udevadm-settle.c +++ b/src/udev/udevadm-settle.c @@ -81,7 +81,7 @@ static int parse_argv(int argc, char *argv[]) { case '?': return -EINVAL; default: - assert_not_reached("Unknown option."); + assert_not_reached(); } } diff --git a/src/udev/udevadm-test-builtin.c b/src/udev/udevadm-test-builtin.c index 008d6f2914..992fc70807 100644 --- a/src/udev/udevadm-test-builtin.c +++ b/src/udev/udevadm-test-builtin.c @@ -45,7 +45,7 @@ static int parse_argv(int argc, char *argv[]) { case '?': return -EINVAL; default: - assert_not_reached("Unknown option"); + assert_not_reached(); } arg_command = argv[optind++]; diff --git a/src/udev/udevadm-test.c b/src/udev/udevadm-test.c index fbac719fa0..f6ec222884 100644 --- a/src/udev/udevadm-test.c +++ b/src/udev/udevadm-test.c @@ -81,7 +81,7 @@ static int parse_argv(int argc, char *argv[]) { case '?': return -EINVAL; default: - assert_not_reached("Unknown option"); + assert_not_reached(); } if (!argv[optind]) diff --git a/src/udev/udevadm-trigger.c b/src/udev/udevadm-trigger.c index 984ec1b84b..8acf3d9b11 100644 --- a/src/udev/udevadm-trigger.c +++ b/src/udev/udevadm-trigger.c @@ -416,7 +416,7 @@ int trigger_main(int argc, char *argv[], void *userdata) { case '?': return -EINVAL; default: - assert_not_reached("Unknown option"); + assert_not_reached(); } } @@ -482,7 +482,7 @@ int trigger_main(int argc, char *argv[], void *userdata) { return log_error_errno(r, "Failed to scan devices: %m"); break; default: - assert_not_reached("Unknown device type"); + assert_not_reached(); } r = exec_list(e, action, settle_hashmap); diff --git a/src/udev/udevadm.c b/src/udev/udevadm.c index e55ae4bd54..ba17d9348b 100644 --- a/src/udev/udevadm.c +++ b/src/udev/udevadm.c @@ -77,7 +77,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } return 1; /* work to do */ diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 13ac7c83b5..5a4657de14 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -1663,7 +1663,7 @@ static int parse_argv(int argc, char *argv[]) { case '?': return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } } diff --git a/src/udev/v4l_id/v4l_id.c b/src/udev/v4l_id/v4l_id.c index 26b634ef5b..c2312c7909 100644 --- a/src/udev/v4l_id/v4l_id.c +++ b/src/udev/v4l_id/v4l_id.c @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } device = argv[optind]; diff --git a/src/userdb/userdbctl.c b/src/userdb/userdbctl.c index 8db0c34fb5..af494d3075 100644 --- a/src/userdb/userdbctl.c +++ b/src/userdb/userdbctl.c @@ -90,7 +90,7 @@ static int show_user(UserRecord *ur, Table *table) { break; default: - assert_not_reached("Unexpected output mode"); + assert_not_reached(); } return 0; @@ -240,7 +240,7 @@ static int show_group(GroupRecord *gr, Table *table) { break; default: - assert_not_reached("Unexpected display mode"); + assert_not_reached(); } return 0; @@ -384,7 +384,7 @@ static int show_membership(const char *user, const char *group, Table *table) { break; default: - assert_not_reached("Unexpected output mode"); + assert_not_reached(); } return 0; @@ -420,7 +420,7 @@ static int display_memberships(int argc, char *argv[], void *userdata) { if (r < 0) return log_error_errno(r, "Failed to enumerate groups of user: %m"); } else - assert_not_reached("Unexpected verb"); + assert_not_reached(); for (;;) { _cleanup_free_ char *user = NULL, *group = NULL; @@ -762,7 +762,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - assert_not_reached("Unhandled option"); + assert_not_reached(); } } |