summaryrefslogtreecommitdiffstats
path: root/sysfs.c
diff options
context:
space:
mode:
authorArtur Paszkiewicz <artur.paszkiewicz@intel.com>2017-04-24 16:03:26 +0200
committerJes Sorensen <jsorensen@fb.com>2017-04-24 23:10:56 +0200
commitb75805662e7208799207a8e5f8a61f69a44888f0 (patch)
tree1578130c984cd37df66a60ba2dc2bc5bbc59208f /sysfs.c
parentmaps: Simplify implementation of map_name() (diff)
downloadmdadm-b75805662e7208799207a8e5f8a61f69a44888f0.tar.xz
mdadm-b75805662e7208799207a8e5f8a61f69a44888f0.zip
Don't use UnSet with consistency_policy
Use CONSISTENCY_POLICY_UNKNOWN instead. Simplify some checks because since 5e8e35fb7e17 ("maps: Use keyvalue for null terminator to indicate 'unset' value") map_name() can return this default directly. Suggested-by: Jes Sorensen <Jes.Sorensen@gmail.com> Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Diffstat (limited to 'sysfs.c')
-rw-r--r--sysfs.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sysfs.c b/sysfs.c
index 712f8b3e..aa30de5c 100644
--- a/sysfs.c
+++ b/sysfs.c
@@ -254,13 +254,11 @@ struct mdinfo *sysfs_read(int fd, char *devnm, unsigned long options)
if (options & GET_CONSISTENCY_POLICY) {
strcpy(base, "consistency_policy");
- if (load_sys(fname, buf, sizeof(buf))) {
+ if (load_sys(fname, buf, sizeof(buf)))
sra->consistency_policy = CONSISTENCY_POLICY_UNKNOWN;
- } else {
- sra->consistency_policy = map_name(consistency_policies, buf);
- if (sra->consistency_policy == UnSet)
- sra->consistency_policy = CONSISTENCY_POLICY_UNKNOWN;
- }
+ else
+ sra->consistency_policy = map_name(consistency_policies,
+ buf);
}
if (! (options & GET_DEVS))