summaryrefslogtreecommitdiff
path: root/src/mount.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-01-15 12:37:16 +0100
committerMichal Schmidt <mschmidt@redhat.com>2012-01-16 13:34:42 +0100
commit595ed347a87e69893c5e72168fc2e94a7cb09e73 (patch)
treec0e9270f001c289c429d4f239b41ac60df75d21b /src/mount.c
parent1124fe6f01b1d59d016c238026f20380f38d98dc (diff)
unit: use safe downcasts, remove pointless casts
Always use the macros for downcasting. Remove a few obviously pointless casts.
Diffstat (limited to 'src/mount.c')
-rw-r--r--src/mount.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mount.c b/src/mount.c
index 5c45686c2..6d0af4ef7 100644
--- a/src/mount.c
+++ b/src/mount.c
@@ -160,7 +160,7 @@ static int mount_add_mount_links(Mount *m) {
* above us in the hierarchy */
LIST_FOREACH(units_by_type, other, UNIT(m)->manager->units_by_type[UNIT_MOUNT]) {
- Mount *n = (Mount*) other;
+ Mount *n = MOUNT(other);
MountParameters *pn;
if (n == m)
@@ -217,7 +217,7 @@ static int mount_add_swap_links(Mount *m) {
assert(m);
LIST_FOREACH(units_by_type, other, UNIT(m)->manager->units_by_type[UNIT_SWAP])
- if ((r = swap_add_one_mount_link((Swap*) other, m)) < 0)
+ if ((r = swap_add_one_mount_link(SWAP(other), m)) < 0)
return r;
return 0;
@@ -230,7 +230,7 @@ static int mount_add_path_links(Mount *m) {
assert(m);
LIST_FOREACH(units_by_type, other, UNIT(m)->manager->units_by_type[UNIT_PATH])
- if ((r = path_add_one_mount_link((Path*) other, m)) < 0)
+ if ((r = path_add_one_mount_link(PATH(other), m)) < 0)
return r;
return 0;
@@ -243,7 +243,7 @@ static int mount_add_automount_links(Mount *m) {
assert(m);
LIST_FOREACH(units_by_type, other, UNIT(m)->manager->units_by_type[UNIT_AUTOMOUNT])
- if ((r = automount_add_one_mount_link((Automount*) other, m)) < 0)
+ if ((r = automount_add_one_mount_link(AUTOMOUNT(other), m)) < 0)
return r;
return 0;
@@ -256,7 +256,7 @@ static int mount_add_socket_links(Mount *m) {
assert(m);
LIST_FOREACH(units_by_type, other, UNIT(m)->manager->units_by_type[UNIT_SOCKET])
- if ((r = socket_add_one_mount_link((Socket*) other, m)) < 0)
+ if ((r = socket_add_one_mount_link(SOCKET(other), m)) < 0)
return r;
return 0;
@@ -1679,7 +1679,7 @@ fail:
}
void mount_fd_event(Manager *m, int events) {
- Unit *meta;
+ Unit *u;
int r;
assert(m);
@@ -1693,8 +1693,8 @@ void mount_fd_event(Manager *m, int events) {
log_error("Failed to reread /proc/self/mountinfo: %s", strerror(-r));
/* Reset flags, just in case, for later calls */
- LIST_FOREACH(units_by_type, meta, m->units_by_type[UNIT_MOUNT]) {
- Mount *mount = (Mount*) meta;
+ LIST_FOREACH(units_by_type, u, m->units_by_type[UNIT_MOUNT]) {
+ Mount *mount = MOUNT(u);
mount->is_mounted = mount->just_mounted = mount->just_changed = false;
}
@@ -1704,8 +1704,8 @@ void mount_fd_event(Manager *m, int events) {
manager_dispatch_load_queue(m);
- LIST_FOREACH(units_by_type, meta, m->units_by_type[UNIT_MOUNT]) {
- Mount *mount = (Mount*) meta;
+ LIST_FOREACH(units_by_type, u, m->units_by_type[UNIT_MOUNT]) {
+ Mount *mount = MOUNT(u);
if (!mount->is_mounted) {
/* This has just been unmounted. */