[PATCH 35/35] fs-tests: integck: assume that the parent is present in new_dir
Artem Bityutskiy
dedekind1 at gmail.com
Wed Apr 20 06:19:08 EDT 2011
From: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
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 at nokia.com>
---
tests/fs-tests/integrity/integck.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index 310e228..9cb0403 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -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;
}
--
1.7.2.3
More information about the linux-mtd
mailing list