diff options
author | Jes Sorensen <jsorensen@fb.com> | 2017-04-21 18:11:21 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2017-04-21 18:11:21 +0200 |
commit | 4a4379b054a72b3c4abd93dd6e1283d6aa992ee2 (patch) | |
tree | 69dc18ab29a82e37b0989f75caef105f48c2fa0a /maps.c | |
parent | maps: Remove incorrect comment about strcmp() (diff) | |
download | mdadm-4a4379b054a72b3c4abd93dd6e1283d6aa992ee2.tar.xz mdadm-4a4379b054a72b3c4abd93dd6e1283d6aa992ee2.zip |
maps: Simplify implementation of map_name()
Reported-By: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to '')
-rw-r--r-- | maps.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -165,11 +165,8 @@ char *map_num(mapping_t *map, int num) int map_name(mapping_t *map, char *name) { - while (map->name) { - if (strcmp(map->name, name)==0) - return map->num; + while (map->name && strcmp(map->name, name) != 0) map++; - } return map->num; } |