tree-wide: drop pointless zero initialization (#16884)

tree-wide: drop pointless zero initialization
This commit is contained in:
fangxiuning
2020-08-28 23:45:54 +08:00
committed by GitHub
parent cd17bb6e71
commit c53aafb7b5
8 changed files with 11 additions and 11 deletions

View File

@@ -106,7 +106,7 @@ int mac_smack_apply_fd(int fd, SmackAttr attr, const char *label) {
int mac_smack_apply_pid(pid_t pid, const char *label) {
const char *p;
int r = 0;
int r;
assert(label);
@@ -232,7 +232,7 @@ int mac_smack_fix_container(const char *path, const char *inside_path, LabelFixF
}
int mac_smack_copy(const char *dest, const char *src) {
int r = 0;
int r;
_cleanup_free_ char *label = NULL;
assert(dest);

View File

@@ -118,7 +118,7 @@ static int get_file_version(int fd, char **v) {
char *buf;
const char *s, *e;
char *x = NULL;
int r = 0;
int r;
assert(fd >= 0);
assert(v);
@@ -248,7 +248,7 @@ static int print_efi_option(uint16_t id, bool in_order) {
_cleanup_free_ char *path = NULL;
sd_id128_t partition;
bool active;
int r = 0;
int r;
r = efi_get_boot_option(id, &title, &partition, &path, &active);
if (r < 0)

View File

@@ -532,7 +532,7 @@ static int tree_one(sd_bus *bus, const char *service) {
static int tree(int argc, char **argv, void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
char **i;
int r = 0;
int r;
/* Do superficial verification of arguments before even opening the bus */
STRV_FOREACH(i, strv_skip(argv, 1))

View File

@@ -340,7 +340,7 @@ static int bus_job_allocate_bus_track(Job *j) {
}
int bus_job_coldplug_bus_track(Job *j) {
int r = 0;
int r;
_cleanup_strv_free_ char **deserialized_clients = NULL;
assert(j);

View File

@@ -1149,7 +1149,7 @@ void bus_track_serialize(sd_bus_track *t, FILE *f, const char *prefix) {
}
int bus_track_coldplug(Manager *m, sd_bus_track **t, bool recursive, char **l) {
int r = 0;
int r;
assert(m);
assert(t);

View File

@@ -1425,7 +1425,7 @@ int swap_process_device_new(Manager *m, sd_device *dev) {
_cleanup_free_ char *e = NULL;
const char *dn, *devlink;
Unit *u;
int r = 0;
int r;
assert(m);
assert(dev);
@@ -1463,7 +1463,7 @@ int swap_process_device_new(Manager *m, sd_device *dev) {
int swap_process_device_remove(Manager *m, sd_device *dev) {
const char *dn;
int r = 0;
int r;
Swap *s;
r = sd_device_get_devname(dev, &dn);

View File

@@ -607,7 +607,7 @@ static int get_process_ns(pid_t pid, const char *namespace, ino_t *ns) {
static int get_mount_namespace_leader(pid_t pid, pid_t *container_pid) {
pid_t cpid = pid, ppid = 0;
ino_t proc_mntns;
int r = 0;
int r;
r = get_process_ns(pid, "mnt", &proc_mntns);
if (r < 0)

View File

@@ -166,7 +166,7 @@ static int trim_cb(const char *path, const struct stat *sb, int typeflag, struct
int cg_trim(const char *controller, const char *path, bool delete_root) {
_cleanup_free_ char *fs = NULL;
int r = 0, q;
int r, q;
assert(path);