summaryrefslogtreecommitdiff
path: root/mdstat.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2008-07-12 20:28:38 +1000
committerNeil Brown <neilb@suse.de>2008-07-12 20:28:38 +1000
commit77472ff8d0a7e72b2da72c05dbbe1bf1adc0f2ca (patch)
tree4d79a8b20371808f0b07b9ab0d0bba00e227a90b /mdstat.c
parentd7161f3b5150d217c8cbbf16a5d567885679b7b8 (diff)
Introduce devname2devnum
and use it instead of opencoding.
Diffstat (limited to 'mdstat.c')
-rw-r--r--mdstat.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/mdstat.c b/mdstat.c
index 040df150..4bb29d85 100644
--- a/mdstat.c
+++ b/mdstat.c
@@ -191,11 +191,7 @@ struct mdstat_ent *mdstat_read(int hold, int start)
* there.
*/
struct mdstat_ent **ih;
- int dn2;
- if (strncmp(w, "md_d", 4)==0)
- dn2 = -1-strtoul(w+4, &ep, 10);
- else
- dn2 = strtoul(w+2, &ep, 10);
+ int dn2 = devname2devnum(w);
ih = &all;
while (ih != insert_here && *ih &&
(*ih)->devnum != dn2)