Bugprone argument comment 9 (#37712)

Follow up from https://github.com/systemd/systemd/pull/37678
This commit is contained in:
Yu Watanabe
2025-06-04 22:33:51 +09:00
committed by GitHub
17 changed files with 25 additions and 25 deletions
+1 -1
View File
@@ -135,7 +135,7 @@ typedef enum CGroupUnified {
*/
int cg_path_open(const char *controller, const char *path);
int cg_cgroupid_open(int fsfd, uint64_t id);
int cg_cgroupid_open(int cgroupfs_fd, uint64_t id);
int cg_path_from_cgroupid(int cgroupfs_fd, uint64_t id, char **ret);
int cg_get_cgroupid_at(int dfd, const char *path, uint64_t *ret);
+1 -1
View File
@@ -2461,7 +2461,7 @@ static int initialize_runtime(
(void) machine_id_setup(/* root = */ NULL, arg_machine_id,
(first_boot ? MACHINE_ID_SETUP_FORCE_TRANSIENT : 0) |
(arg_machine_id_from_firmware ? MACHINE_ID_SETUP_FORCE_FIRMWARE : 0),
/* ret_machine_id = */ NULL);
/* ret = */ NULL);
(void) hostname_setup(/* really = */ true);
(void) loopback_setup();
+1 -1
View File
@@ -816,7 +816,7 @@ static int add_root_mount(void) {
return 0;
}
r = efi_loader_get_device_part_uuid(/* ret_uuid= */ NULL);
r = efi_loader_get_device_part_uuid(/* ret= */ NULL);
if (r == -ENOENT) {
log_notice("EFI loader partition unknown, not processing %s.\n"
"(The boot loader did not set EFI variable LoaderDevicePartUUID.)",
+3 -3
View File
@@ -241,7 +241,7 @@ static int list_homes(int argc, char *argv[], void *userdata) {
static int acquire_existing_password(
const char *user_name,
UserRecord *hr,
bool emphasize_current,
bool emphasize_current_password,
AskPasswordFlags flags) {
_cleanup_strv_free_erase_ char **password = NULL;
@@ -271,7 +271,7 @@ static int acquire_existing_password(
if (is_this_me(user_name) <= 0)
SET_FLAG(flags, ASK_PASSWORD_ACCEPT_CACHED|ASK_PASSWORD_PUSH_CACHE, false);
if (asprintf(&question, emphasize_current ?
if (asprintf(&question, emphasize_current_password ?
"Please enter current password for user %s:" :
"Please enter password for user %s:",
user_name) < 0)
@@ -1453,7 +1453,7 @@ static int create_home_common(sd_json_variant *input, bool show_enforce_password
r = acquire_existing_password(
hr->user_name,
hr,
/* emphasize_current= */ false,
/* emphasize_current_password= */ false,
ASK_PASSWORD_ACCEPT_CACHED | ASK_PASSWORD_PUSH_CACHE);
if (r < 0)
return r;
+1 -1
View File
@@ -17,7 +17,7 @@ static void curl_glue_check_finished(CurlGlue *g) {
assert(g);
/* sd_event_get_exit_code() returns -ENODATA if no exit was scheduled yet */
r = sd_event_get_exit_code(g->event, /* ret_code= */ NULL);
r = sd_event_get_exit_code(g->event, /* ret= */ NULL);
if (r >= 0)
return; /* exit scheduled? Then don't process this anymore */
if (r != -ENODATA)
+1 -1
View File
@@ -723,7 +723,7 @@ TEST(sock_diag_unix) {
ASSERT_OK(sd_sock_diag_message_new_unix(nl, &message, st.st_ino, cookie, UDIAG_SHOW_RQLEN));
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *reply = NULL;
r = sd_netlink_call(nl, message, /* usec= */ 0, &reply);
r = sd_netlink_call(nl, message, /* timeout= */ 0, &reply);
if (r == -ENOENT)
return (void) log_tests_skipped("CONFIG_UNIX_DIAG disabled");
ASSERT_OK(r);
+1 -1
View File
@@ -899,7 +899,7 @@ static int varlink_idl_subparse_field_type(
} else {
_cleanup_free_ char *token = NULL;
r = varlink_idl_subparse_token(p, line, column, /* valid_tokens= */ NULL, VALID_CHARS_IDENTIFIER, &token);
r = varlink_idl_subparse_token(p, line, column, /* allowed_delimiters= */ NULL, VALID_CHARS_IDENTIFIER, &token);
if (r < 0)
return r;
if (!token)
+1 -1
View File
@@ -935,7 +935,7 @@ int manager_create_session(
}
/* Check if we are already in a logind session, and if so refuse. */
r = manager_get_session_by_pidref(m, leader, /* ret_session= */ NULL);
r = manager_get_session_by_pidref(m, leader, /* ret= */ NULL);
if (r < 0)
return log_debug_errno(
r,
+1 -1
View File
@@ -279,7 +279,7 @@ static int start_workers(Manager *m, bool explicit_request) {
&m->deferred_start_worker_event_source,
CLOCK_MONOTONIC,
ratelimit_end(&m->worker_ratelimit),
/* accuracy_usec= */ 0,
/* accuracy= */ 0,
on_deferred_start_worker,
m);
if (r < 0)
+6 -6
View File
@@ -379,13 +379,13 @@ static int uid_is_available(
if (r > 0)
return false;
r = userdb_by_uid(candidate, /* match= */ NULL, USERDB_AVOID_MULTIPLEXER, /* ret_record= */ NULL);
r = userdb_by_uid(candidate, /* match= */ NULL, USERDB_AVOID_MULTIPLEXER, /* ret= */ NULL);
if (r >= 0)
return false;
if (r != -ESRCH)
return r;
r = groupdb_by_gid(candidate, /* match= */ NULL, USERDB_AVOID_MULTIPLEXER, /* ret_record= */ NULL);
r = groupdb_by_gid(candidate, /* match= */ NULL, USERDB_AVOID_MULTIPLEXER, /* ret= */ NULL);
if (r >= 0)
return false;
if (r != -ESRCH)
@@ -416,13 +416,13 @@ static int name_is_available(
if (!user_name)
return -ENOMEM;
r = userdb_by_name(user_name, /* match= */ NULL, USERDB_AVOID_MULTIPLEXER, /* ret_record= */ NULL);
r = userdb_by_name(user_name, /* match= */ NULL, USERDB_AVOID_MULTIPLEXER, /* ret= */ NULL);
if (r >= 0)
return false;
if (r != -ESRCH)
return r;
r = groupdb_by_name(user_name, /* match= */ NULL, USERDB_AVOID_MULTIPLEXER, /* ret_record= */ NULL);
r = groupdb_by_name(user_name, /* match= */ NULL, USERDB_AVOID_MULTIPLEXER, /* ret= */ NULL);
if (r >= 0)
return false;
if (r != -ESRCH)
@@ -1248,7 +1248,7 @@ static int vl_method_add_mount_to_user_namespace(sd_varlink *link, sd_json_varia
link,
/* bus= */ NULL,
"io.systemd.namespace-resource.delegate-mount",
/* polkit_details= */ NULL,
/* details= */ NULL,
/* good_user= */ UID_INVALID,
POLKIT_DEFAULT_ALLOW, /* If no polkit is installed, allow delegation of mounts to registered userns */
&c->polkit_registry);
@@ -1401,7 +1401,7 @@ static int vl_method_add_cgroup_to_user_namespace(sd_varlink *link, sd_json_vari
link,
/* bus= */ NULL,
"io.systemd.namespace-resource.delegate-cgroup",
/* polkit_details= */ NULL,
/* details= */ NULL,
/* good_user= */ UID_INVALID,
POLKIT_DEFAULT_ALLOW, /* If no polkit is installed, allow delegation of cgroups to registered userns */
&c->polkit_registry);
+2 -2
View File
@@ -639,7 +639,7 @@ static int userns_destroy_cgroup(uint64_t cgroup_id) {
_cleanup_close_ int cgroup_fd = -EBADF, parent_fd = -EBADF;
int r;
cgroup_fd = cg_cgroupid_open(/* cgroupfsfd= */ -EBADF, cgroup_id);
cgroup_fd = cg_cgroupid_open(/* cgroupfs_fd= */ -EBADF, cgroup_id);
if (cgroup_fd == -ESTALE) {
log_debug_errno(cgroup_fd, "Control group %" PRIu64 " already gone, ignoring.", cgroup_id);
return 0;
@@ -738,7 +738,7 @@ static int userns_destroy_netif(sd_netlink **rtnl, const char *name) {
if (r < 0)
return r;
r = sd_netlink_call(*rtnl, m, /* timeout_usec= */ 0, /* ret_reply= */ NULL);
r = sd_netlink_call(*rtnl, m, /* timeout= */ 0, /* ret= */ NULL);
if (ERRNO_IS_NEG_DEVICE_ABSENT(r)) /* Already gone? */
return 0;
if (r < 0)
+1 -1
View File
@@ -4805,7 +4805,7 @@ static int partition_encrypt(Context *context, Partition *p, PartitionTarget *ta
r = tpm2_calculate_sealing_policy(
arg_tpm2_hash_pcr_values,
arg_tpm2_n_hash_pcr_values,
/* pubkey= */ NULL, /* Turn this one off for the 2nd shard */
/* public= */ NULL, /* Turn this one off for the 2nd shard */
/* use_pin= */ false,
&pcrlock_policy, /* But turn this one on */
policy_hash + 1);
+1 -1
View File
@@ -369,7 +369,7 @@ void dns_query_candidate_notify(DnsQueryCandidate *c) {
c->query->manager->event,
&c->timeout_event_source,
CLOCK_BOOTTIME,
CANDIDATE_EXPEDITED_TIMEOUT_USEC, /* accuracy_usec= */ 0,
CANDIDATE_EXPEDITED_TIMEOUT_USEC, /* accuracy= */ 0,
on_candidate_timeout, c,
/* priority= */ 0, "candidate-timeout",
/* force_reset= */ false);
+1 -1
View File
@@ -60,7 +60,7 @@ static int lookup_key(const char *keyname, key_serial_t *ret) {
assert(keyname);
assert(ret);
serial = request_key("user", keyname, /* callout_info= */ NULL, /* dest_keyring= */ 0);
serial = request_key("user", keyname, /* callout_info= */ NULL, /* destringid= */ 0);
if (serial == -1)
return negative_errno();
+1 -1
View File
@@ -85,7 +85,7 @@ int generator_write_cryptsetup_service_section(
FILE *f,
const char *name,
const char *what,
const char *password,
const char *key_file,
const char *options);
int generator_write_veritysetup_unit_section(FILE *f, const char *source);
+1 -1
View File
@@ -510,7 +510,7 @@ int af_unix_get_qlen(int fd, uint32_t *ret) {
return r;
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *reply = NULL;
r = sd_netlink_call(nl, message, /* usec= */ 0, &reply);
r = sd_netlink_call(nl, message, /* timeout= */ 0, &reply);
if (r < 0)
return r;
+1 -1
View File
@@ -247,7 +247,7 @@ static int start_workers(Manager *m, bool explicit_request) {
&m->deferred_start_worker_event_source,
CLOCK_MONOTONIC,
ratelimit_end(&m->worker_ratelimit),
/* accuracy_usec= */ 0,
/* accuracy= */ 0,
on_deferred_start_worker,
m);
if (r < 0)