From: fangxiuning <53254947+JackFangXN@users.noreply.github.com> Date: Fri, 28 Aug 2020 15:45:54 +0000 (+0800) Subject: tree-wide: drop pointless zero initialization (#16884) X-Git-Tag: v247-rc1~339 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c53aafb7b5bbbfd8336b189040e183fdc5394b5a;p=thirdparty%2Fsystemd.git tree-wide: drop pointless zero initialization (#16884) tree-wide: drop pointless zero initialization --- diff --git a/src/basic/smack-util.c b/src/basic/smack-util.c index 8043a97c359..7bb0746b6c8 100644 --- a/src/basic/smack-util.c +++ b/src/basic/smack-util.c @@ -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); diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index 11278219dd6..94bd1788f8d 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -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) diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index ccb22d5f8bc..3447f305a7f 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -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)) diff --git a/src/core/dbus-job.c b/src/core/dbus-job.c index 33e4128909b..0859bb3779e 100644 --- a/src/core/dbus-job.c +++ b/src/core/dbus-job.c @@ -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); diff --git a/src/core/dbus.c b/src/core/dbus.c index 76bb91d0ea1..8958af48ce4 100644 --- a/src/core/dbus.c +++ b/src/core/dbus.c @@ -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); diff --git a/src/core/swap.c b/src/core/swap.c index 83ae66c964d..e8bf0ad12d7 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -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); diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c index 9b7811ae54a..1c4af5c8131 100644 --- a/src/coredump/coredump.c +++ b/src/coredump/coredump.c @@ -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) diff --git a/src/shared/cgroup-setup.c b/src/shared/cgroup-setup.c index 610e2f30cf6..e9995645eb4 100644 --- a/src/shared/cgroup-setup.c +++ b/src/shared/cgroup-setup.c @@ -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);