summaryrefslogtreecommitdiff
path: root/fs_test
diff options
context:
space:
mode:
authorgkostka <kostka.grzegorz@gmail.com>2015-12-31 00:38:12 +0100
committergkostka <kostka.grzegorz@gmail.com>2015-12-31 00:38:12 +0100
commitba407e042e22ed6ed567aa8dd4365da84bff0449 (patch)
tree491721f5ff1f2074c50daabad4c49bc3b2575257 /fs_test
parent45764c06a8ed8b23c5e0961976d7deefd57fcd73 (diff)
fs_test: simplify open_filedev implementation
Diffstat (limited to 'fs_test')
-rw-r--r--fs_test/lwext4_generic.c13
-rw-r--r--fs_test/lwext4_mbr.c10
-rw-r--r--fs_test/lwext4_mkfs.c10
3 files changed, 9 insertions, 24 deletions
diff --git a/fs_test/lwext4_generic.c b/fs_test/lwext4_generic.c
index 21a4526..dc6023a 100644
--- a/fs_test/lwext4_generic.c
+++ b/fs_test/lwext4_generic.c
@@ -148,6 +148,10 @@ static bool open_windows(void)
#endif
}
+static bool open_filedev(void)
+{
+ return winpart ? open_windows() : open_linux();
+}
static bool parse_opt(int argc, char **argv)
{
@@ -216,12 +220,9 @@ int main(int argc, char **argv)
printf("\trw count: %d\n", rw_count);
printf("\tcache mode: %s\n", cache_mode ? "dynamic" : "static");
- if (winpart) {
- if (!open_windows())
- return EXIT_FAILURE;
- } else {
- if (!open_linux())
- return EXIT_FAILURE;
+ if (!open_filedev()) {
+ printf("open_filedev error\n");
+ return EXIT_FAILURE;
}
diff --git a/fs_test/lwext4_mbr.c b/fs_test/lwext4_mbr.c
index 8c37c09..8c7602b 100644
--- a/fs_test/lwext4_mbr.c
+++ b/fs_test/lwext4_mbr.c
@@ -93,15 +93,7 @@ static bool open_windows(void)
static bool open_filedev(void)
{
- if (winpart) {
- if (!open_windows())
- return false;
- } else {
- if (!open_linux())
- return false;
- }
-
- return true;
+ return winpart ? open_windows() : open_linux();
}
static bool parse_opt(int argc, char **argv)
diff --git a/fs_test/lwext4_mkfs.c b/fs_test/lwext4_mkfs.c
index b7ff601..aa7e1ef 100644
--- a/fs_test/lwext4_mkfs.c
+++ b/fs_test/lwext4_mkfs.c
@@ -102,15 +102,7 @@ static bool open_windows(void)
static bool open_filedev(void)
{
- if (winpart) {
- if (!open_windows())
- return false;
- } else {
- if (!open_linux())
- return false;
- }
-
- return true;
+ return winpart ? open_windows() : open_linux();
}
static bool parse_opt(int argc, char **argv)