]> www.infradead.org Git - mtd-utils.git/commitdiff
fs-tests: integck: assume that the parent is present in new_dir
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Wed, 20 Apr 2011 09:54:12 +0000 (12:54 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 22 Apr 2011 11:29:53 +0000 (14:29 +0300)
We always pass non-NULL 'parent' argument to 'new_dir()', so no need to
test it for NULL.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
tests/fs-tests/integrity/integck.c

index 310e228e89c2f5bd59d58cf7f53b4519805fbe27..9cb040355521ba7b34001d487a88e26a97c529a3 100644 (file)
@@ -455,6 +455,8 @@ static int dir_new(struct dir_info *parent, const char *name)
        struct dir_info *dir;
        char *path;
 
+       assert(parent);
+
        path = dir_path(parent, name);
        if (mkdir(path, 0777) != 0) {
                if (errno == ENOSPC) {
@@ -469,8 +471,7 @@ static int dir_new(struct dir_info *parent, const char *name)
        free(path);
 
        dir = zalloc(sizeof(struct dir_info));
-       if (parent)
-               add_dir_entry(parent, 'd', name, dir);
+       add_dir_entry(parent, 'd', name, dir);
        return 0;
 }