summaryrefslogtreecommitdiff
path: root/libdm/ioctl
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2017-07-19 16:16:12 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2017-07-20 11:18:29 +0200
commit0bf836aa14f98eb83969a6e81695a024f56a5eb5 (patch)
tree389b12c7074c06d4fca1403280b6275b8e930d51 /libdm/ioctl
parent0d0a3397c22b9d5342584299acd814f6c8221c18 (diff)
downloadlvm2-0bf836aa14f98eb83969a6e81695a024f56a5eb5.tar.gz
tidy: prefer not using else after return
clang-tidy: avoid using 'else' after return - give more readable code, and also saves indention level.
Diffstat (limited to 'libdm/ioctl')
-rw-r--r--libdm/ioctl/libdm-iface.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c
index 65e75f667..c47e08467 100644
--- a/libdm/ioctl/libdm-iface.c
+++ b/libdm/ioctl/libdm-iface.c
@@ -208,8 +208,9 @@ static int _get_proc_number(const char *file, const char *name,
if (require_module_loaded) {
log_error("%s: No entry for %s found", file, name);
return 0;
- } else
- return 2;
+ }
+
+ return 2;
}
return 1;
@@ -368,11 +369,11 @@ int dm_is_dm_major(uint32_t major)
return 0;
return dm_bit(_dm_bitset, major) ? 1 : 0;
}
- else {
- if (!_dm_device_major)
- return 0;
- return (major == _dm_device_major) ? 1 : 0;
- }
+
+ if (!_dm_device_major)
+ return 0;
+
+ return (major == _dm_device_major) ? 1 : 0;
}
static void _close_control_fd(void)
@@ -1704,7 +1705,9 @@ static int _do_dm_ioctl_unmangle_string(char *str, const char *str_name,
log_debug_activation("_do_dm_ioctl_unmangle_string: failed to "
"unmangle %s \"%s\"", str_name, str);
return 0;
- } else if (r)
+ }
+
+ if (r)
memcpy(str, buf, strlen(buf) + 1);
return 1;