Bugprone argument comments - round 3 (#37356)
Follow up from https://github.com/systemd/systemd/pull/37346
This commit is contained in:
@@ -94,7 +94,7 @@ static int status_entries(
|
||||
boot_config_default_entry(config),
|
||||
/* show_as_default= */ false,
|
||||
/* show_as_selected= */ false,
|
||||
/* show_discovered= */ false);
|
||||
/* show_reported= */ false);
|
||||
if (r > 0)
|
||||
/* < 0 is already logged by the function itself, let's just emit an extra warning if
|
||||
the default entry is broken */
|
||||
|
||||
@@ -661,7 +661,7 @@ static int asynchronous_expire(int dev_autofs_fd, int ioctl_fd) {
|
||||
(int[]) { dev_autofs_fd, ioctl_fd },
|
||||
/* n_except_fds= */ 2,
|
||||
FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS|FORK_REOPEN_LOG,
|
||||
/* pid= */ NULL);
|
||||
/* ret_pid= */ NULL);
|
||||
if (r != 0)
|
||||
return r;
|
||||
|
||||
|
||||
+2
-2
@@ -3056,7 +3056,7 @@ int unit_check_oomd_kill(Unit *u) {
|
||||
LOG_UNIT_INVOCATION_ID(u),
|
||||
LOG_UNIT_MESSAGE(u, "systemd-oomd killed some process(es) in this unit."));
|
||||
|
||||
unit_notify_cgroup_oom(u, /* ManagedOOM= */ true);
|
||||
unit_notify_cgroup_oom(u, /* managed_oom= */ true);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -3098,7 +3098,7 @@ int unit_check_oom(Unit *u) {
|
||||
LOG_UNIT_INVOCATION_ID(u),
|
||||
LOG_UNIT_MESSAGE(u, "A process of this unit has been killed by the OOM killer."));
|
||||
|
||||
unit_notify_cgroup_oom(u, /* ManagedOOM= */ false);
|
||||
unit_notify_cgroup_oom(u, /* managed_oom= */ false);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1771,7 +1771,7 @@ void bus_unit_send_pending_change_signal(Unit *u, bool including_new) {
|
||||
bus_unit_send_change_signal(u);
|
||||
}
|
||||
|
||||
int bus_unit_send_pending_freezer_message(Unit *u, bool cancelled) {
|
||||
int bus_unit_send_pending_freezer_message(Unit *u, bool canceled) {
|
||||
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
|
||||
int r;
|
||||
|
||||
@@ -1780,7 +1780,7 @@ int bus_unit_send_pending_freezer_message(Unit *u, bool cancelled) {
|
||||
if (!u->pending_freezer_invocation)
|
||||
return 0;
|
||||
|
||||
if (cancelled)
|
||||
if (canceled)
|
||||
r = sd_bus_message_new_method_error(
|
||||
u->pending_freezer_invocation,
|
||||
&reply,
|
||||
|
||||
@@ -10,7 +10,7 @@ extern const sd_bus_vtable bus_unit_cgroup_vtable[];
|
||||
|
||||
void bus_unit_send_change_signal(Unit *u);
|
||||
void bus_unit_send_pending_change_signal(Unit *u, bool including_new);
|
||||
int bus_unit_send_pending_freezer_message(Unit *u, bool cancelled);
|
||||
int bus_unit_send_pending_freezer_message(Unit *u, bool canceled);
|
||||
void bus_unit_send_removed_signal(Unit *u);
|
||||
|
||||
int bus_unit_method_start_generic(sd_bus_message *message, Unit *u, JobType job_type, bool reload_if_possible, sd_bus_error *error);
|
||||
|
||||
@@ -1333,7 +1333,7 @@ static int mount_private_apivfs(
|
||||
/* We lack permissions to mount a new instance, and it is not already mounted. But we can
|
||||
* access the host's, so as a final fallback bind-mount it to the destination, as most likely
|
||||
* we are inside a user manager in an unprivileged user namespace. */
|
||||
r = mount_nofollow_verbose(LOG_DEBUG, bind_source, entry_path, /* fstype = */ NULL, MS_BIND|MS_REC, /* opts = */ NULL);
|
||||
r = mount_nofollow_verbose(LOG_DEBUG, bind_source, entry_path, /* fstype = */ NULL, MS_BIND|MS_REC, /* options = */ NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -1348,7 +1348,7 @@ static int mount_private_apivfs(
|
||||
log_debug_errno(r, "Failed to unmount directories below '%s', ignoring: %m", entry_path);
|
||||
|
||||
/* Then, move the new mount instance. */
|
||||
r = mount_nofollow_verbose(LOG_DEBUG, temporary_mount, entry_path, /* fstype = */ NULL, MS_MOVE, /* opts = */ NULL);
|
||||
r = mount_nofollow_verbose(LOG_DEBUG, temporary_mount, entry_path, /* fstype = */ NULL, MS_MOVE, /* options = */ NULL);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
+1
-1
@@ -4170,7 +4170,7 @@ PresetAction unit_get_unit_file_preset(Unit *u) {
|
||||
u->manager->runtime_scope,
|
||||
/* root_dir= */ NULL,
|
||||
bn,
|
||||
/* cache= */ NULL));
|
||||
/* cached= */ NULL));
|
||||
}
|
||||
|
||||
Unit* unit_ref_set(UnitRef *ref, Unit *source, Unit *target) {
|
||||
|
||||
@@ -305,7 +305,7 @@ static int vl_method_get_factory_reset_mode(sd_varlink *link, sd_json_variant *p
|
||||
|
||||
assert(parameters);
|
||||
|
||||
r = sd_varlink_dispatch(link, parameters, /* table= */ NULL, /* userdata= */ NULL);
|
||||
r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL);
|
||||
if (r != 0)
|
||||
return r;
|
||||
|
||||
@@ -321,7 +321,7 @@ static int vl_method_can_request_factory_reset(sd_varlink *link, sd_json_variant
|
||||
|
||||
assert(parameters);
|
||||
|
||||
r = sd_varlink_dispatch(link, parameters, /* table= */ NULL, /* userdata= */ NULL);
|
||||
r = sd_varlink_dispatch(link, parameters, /* dispatch_table= */ NULL, /* userdata= */ NULL);
|
||||
if (r != 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -148,8 +148,8 @@ static void test_dhcp_identifier_set_iaid(void) {
|
||||
uint32_t iaid_legacy;
|
||||
be32_t iaid;
|
||||
|
||||
assert_se(dhcp_identifier_set_iaid(NULL, &hw_addr, /* legacy = */ true, &iaid_legacy) >= 0);
|
||||
assert_se(dhcp_identifier_set_iaid(NULL, &hw_addr, /* legacy = */ false, &iaid) >= 0);
|
||||
assert_se(dhcp_identifier_set_iaid(NULL, &hw_addr, /* legacy_unstable_byteorder = */ true, &iaid_legacy) >= 0);
|
||||
assert_se(dhcp_identifier_set_iaid(NULL, &hw_addr, /* legacy_unstable_byteorder = */ false, &iaid) >= 0);
|
||||
|
||||
/* we expect, that the MAC address was hashed. The legacy value is in native
|
||||
* endianness. */
|
||||
@@ -169,7 +169,7 @@ static int check_options(uint8_t code, uint8_t len, const void *option, void *us
|
||||
uint32_t iaid;
|
||||
|
||||
assert_se(sd_dhcp_duid_set_en(&duid) >= 0);
|
||||
assert_se(dhcp_identifier_set_iaid(NULL, &hw_addr, /* legacy = */ true, &iaid) >= 0);
|
||||
assert_se(dhcp_identifier_set_iaid(NULL, &hw_addr, /* legacy_unstable_byteorder = */ true, &iaid) >= 0);
|
||||
|
||||
assert_se(len == sizeof(uint8_t) + sizeof(uint32_t) + duid.size);
|
||||
assert_se(len == 19);
|
||||
|
||||
@@ -2106,7 +2106,7 @@ static int delay_shutdown_or_sleep(
|
||||
m->event, &m->inhibit_timeout_source,
|
||||
CLOCK_MONOTONIC, m->inhibit_delay_max, /* accuracy = */ 0,
|
||||
manager_inhibit_timeout_handler, m,
|
||||
/* priority = */ 0, "inhibit-timeout", /* force = */ true);
|
||||
/* priority = */ 0, "inhibit-timeout", /* force_reset = */ true);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to reset timer event source for inhibit timeout: %m");
|
||||
|
||||
|
||||
+1
-1
@@ -1088,7 +1088,7 @@ static int manager_dispatch_reload_signal(sd_event_source *s, const struct signa
|
||||
else
|
||||
log_info("Config file reloaded.");
|
||||
|
||||
(void) sd_notify(/* unset= */ false, NOTIFY_READY_MESSAGE);
|
||||
(void) sd_notify(/* unset_environment= */ false, NOTIFY_READY_MESSAGE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -660,7 +660,7 @@ static int manager_dispatch_reload_signal(sd_event_source *s, const struct signa
|
||||
manager_set_defaults(m);
|
||||
manager_parse_config_file(m);
|
||||
|
||||
(void) sd_notify(/* unset= */ false, NOTIFY_READY_MESSAGE);
|
||||
(void) sd_notify(/* unset_environment= */ false, NOTIFY_READY_MESSAGE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -690,7 +690,7 @@ static int manager_dispatch_reload_signal(sd_event_source *s, const struct signa
|
||||
manager_flush_caches(m, LOG_INFO);
|
||||
manager_verify_all(m);
|
||||
|
||||
(void) sd_notify(/* unset= */ false, NOTIFY_READY_MESSAGE);
|
||||
(void) sd_notify(/* unset_environment= */ false, NOTIFY_READY_MESSAGE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1999,7 +1999,7 @@ int show_boot_entries(const BootConfig *config, sd_json_format_flags_t json_form
|
||||
config->entries + n,
|
||||
/* show_as_default= */ n == (size_t) config->default_entry,
|
||||
/* show_as_selected= */ n == (size_t) config->selected_entry,
|
||||
/* show_discovered= */ true);
|
||||
/* show_reported= */ true);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
@@ -176,8 +176,8 @@ static inline int probe_filesystem(const char *path, char **ret_fstype) {
|
||||
int dissect_log_error(int log_level, int r, const char *name, const VeritySettings *verity);
|
||||
int dissect_image_file(const char *path, const VeritySettings *verity, const MountOptions *mount_options, const ImagePolicy *image_policy, const ImageFilter *filter, DissectImageFlags flags, DissectedImage **ret);
|
||||
int dissect_image_file_and_warn(const char *path, const VeritySettings *verity, const MountOptions *mount_options, const ImagePolicy *image_policy, const ImageFilter *filter, DissectImageFlags flags, DissectedImage **ret);
|
||||
int dissect_loop_device(LoopDevice *loop, const VeritySettings *verity, const MountOptions *mount_options, const ImagePolicy *image_policy, const ImageFilter *filter, DissectImageFlags flags, DissectedImage **ret);
|
||||
int dissect_loop_device_and_warn(LoopDevice *loop, const VeritySettings *verity, const MountOptions *mount_options, const ImagePolicy *image_policy, const ImageFilter *filter, DissectImageFlags flags, DissectedImage **ret);
|
||||
int dissect_loop_device(LoopDevice *loop, const VeritySettings *verity, const MountOptions *mount_options, const ImagePolicy *image_policy, const ImageFilter *image_filter, DissectImageFlags flags, DissectedImage **ret);
|
||||
int dissect_loop_device_and_warn(LoopDevice *loop, const VeritySettings *verity, const MountOptions *mount_options, const ImagePolicy *image_policy, const ImageFilter *image_filter, DissectImageFlags flags, DissectedImage **ret);
|
||||
|
||||
void dissected_image_close(DissectedImage *m);
|
||||
DissectedImage* dissected_image_unref(DissectedImage *m);
|
||||
|
||||
@@ -124,7 +124,7 @@ static void context_reset_timer(Context *context) {
|
||||
r = event_reset_time_relative(
|
||||
context->event, &context->idle_time, CLOCK_MONOTONIC,
|
||||
arg_exit_idle_time, 0, idle_time_cb, context,
|
||||
SD_EVENT_PRIORITY_NORMAL, "idle-timer", /* force = */ true);
|
||||
SD_EVENT_PRIORITY_NORMAL, "idle-timer", /* force_reset = */ true);
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to reset idle timer, ignoring: %m");
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ int sd_varlink_get_current_method(sd_varlink *v, const char **ret);
|
||||
int sd_varlink_get_current_parameters(sd_varlink *v, sd_json_variant **ret);
|
||||
|
||||
/* Parsing incoming data via json_dispatch() and generate a nice error on parse errors */
|
||||
int sd_varlink_dispatch(sd_varlink *v, sd_json_variant *parameters, const sd_json_dispatch_field table[], void *userdata);
|
||||
int sd_varlink_dispatch(sd_varlink *v, sd_json_variant *parameters, const sd_json_dispatch_field dispatch_table[], void *userdata);
|
||||
|
||||
/* Write outgoing fds into the socket (to be associated with the next enqueued message) */
|
||||
int sd_varlink_push_fd(sd_varlink *v, int fd);
|
||||
|
||||
@@ -423,7 +423,7 @@ TEST(openssl_cipher) {
|
||||
"32c62bbaeb0decc5c874b8e0148f86475b5bb10a36f7078a75a6f11704c2f06a",
|
||||
/* hex_iv= */ NULL,
|
||||
/* data= */ NULL, /* n_data= */ 0,
|
||||
/* expected= */ NULL);
|
||||
/* hex_expected= */ NULL);
|
||||
|
||||
check_cipher(
|
||||
"aes", 128, "cfb",
|
||||
@@ -451,14 +451,14 @@ TEST(openssl_cipher) {
|
||||
"b8fe4b89f6f25dd58cadceb68c99d508",
|
||||
/* hex_iv= */ NULL,
|
||||
/* data= */ NULL, /* n_data= */ 0,
|
||||
/* expected= */ NULL);
|
||||
/* hex_expected= */ NULL);
|
||||
|
||||
check_cipher(
|
||||
"aes", 128, "cfb",
|
||||
"b8fe4b89f6f25dd58cadceb68c99d508",
|
||||
"00000000000000000000000000000000",
|
||||
/* data= */ NULL, /* n_data= */ 0,
|
||||
/* expected= */ NULL);
|
||||
/* hex_expected= */ NULL);
|
||||
}
|
||||
|
||||
TEST(ecc_ecdh) {
|
||||
|
||||
Reference in New Issue
Block a user