summaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorJes Sorensen <jsorensen@fb.com>2017-05-16 19:52:15 +0200
committerJes Sorensen <jsorensen@fb.com>2017-05-16 19:52:15 +0200
commitfc54fe7a7e77fdb6316d332d4d41d0ed2293d6be (patch)
treed39dfb23d1a1c72bfa4a033bb31449f0c20cf87e /util.c
parentsuper-ddf: sysfs_read() takes a pointer as device name argument (diff)
downloadmdadm-fc54fe7a7e77fdb6316d332d4d41d0ed2293d6be.tar.xz
mdadm-fc54fe7a7e77fdb6316d332d4d41d0ed2293d6be.zip
mdadm: Fixup a large number of bad formatting of logical operators
Logical oprators never belong at the beginning of a line. Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'util.c')
-rw-r--r--util.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/util.c b/util.c
index fc9cd3f1..0564c0be 100644
--- a/util.c
+++ b/util.c
@@ -1014,21 +1014,18 @@ char *get_md_name(char *devnm)
if (strncmp(devnm, "md_", 3) == 0) {
snprintf(devname, sizeof(devname), "/dev/md/%s",
devnm + 3);
- if (stat(devname, &stb) == 0
- && (S_IFMT&stb.st_mode) == S_IFBLK
- && (stb.st_rdev == rdev))
+ if (stat(devname, &stb) == 0 &&
+ (S_IFMT&stb.st_mode) == S_IFBLK && (stb.st_rdev == rdev))
return devname;
}
snprintf(devname, sizeof(devname), "/dev/%s", devnm);
- if (stat(devname, &stb) == 0
- && (S_IFMT&stb.st_mode) == S_IFBLK
- && (stb.st_rdev == rdev))
+ if (stat(devname, &stb) == 0 && (S_IFMT&stb.st_mode) == S_IFBLK &&
+ (stb.st_rdev == rdev))
return devname;
snprintf(devname, sizeof(devname), "/dev/md/%s", devnm+2);
- if (stat(devname, &stb) == 0
- && (S_IFMT&stb.st_mode) == S_IFBLK
- && (stb.st_rdev == rdev))
+ if (stat(devname, &stb) == 0 && (S_IFMT&stb.st_mode) == S_IFBLK &&
+ (stb.st_rdev == rdev))
return devname;
dn = map_dev(major(rdev), minor(rdev), 0);
@@ -1039,9 +1036,8 @@ char *get_md_name(char *devnm)
if (errno != EEXIST)
return NULL;
- if (stat(devname, &stb) == 0
- && (S_IFMT&stb.st_mode) == S_IFBLK
- && (stb.st_rdev == rdev))
+ if (stat(devname, &stb) == 0 && (S_IFMT&stb.st_mode) == S_IFBLK &&
+ (stb.st_rdev == rdev))
return devname;
unlink(devname);
return NULL;