diff options
| author | gkostka <kostka.grzegorz@gmail.com> | 2015-12-31 00:38:12 +0100 |
|---|---|---|
| committer | gkostka <kostka.grzegorz@gmail.com> | 2015-12-31 00:38:12 +0100 |
| commit | ba407e042e22ed6ed567aa8dd4365da84bff0449 (patch) | |
| tree | 491721f5ff1f2074c50daabad4c49bc3b2575257 /fs_test | |
| parent | 45764c06a8ed8b23c5e0961976d7deefd57fcd73 (diff) | |
fs_test: simplify open_filedev implementation
Diffstat (limited to 'fs_test')
| -rw-r--r-- | fs_test/lwext4_generic.c | 13 | ||||
| -rw-r--r-- | fs_test/lwext4_mbr.c | 10 | ||||
| -rw-r--r-- | fs_test/lwext4_mkfs.c | 10 |
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) |
