summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Moyer <jmoyer@redhat.com>2019-11-12 17:12:51 -0700
committerJens Axboe <axboe@kernel.dk>2019-11-12 17:12:51 -0700
commite1420b89cd5954d4ca72cc6ab3005cc78ee9061a (patch)
tree82d4371c45e63556c19d7ed5d9d0584e603b23c4
parenta8f853698f22d14f72eca9100bd436eab919b047 (diff)
downloadliburing-e1420b89cd5954d4ca72cc6ab3005cc78ee9061a.tar.gz
liburing-e1420b89cd5954d4ca72cc6ab3005cc78ee9061a.tar.bz2
test: fix up dead code bugs
Coverity pointed out some dead code. Fix it. Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/fsync.c8
-rw-r--r--test/nop.c8
-rw-r--r--test/stdout.c8
3 files changed, 12 insertions, 12 deletions
diff --git a/test/fsync.c b/test/fsync.c
index e6e0898..1a1890e 100644
--- a/test/fsync.c
+++ b/test/fsync.c
@@ -96,14 +96,14 @@ static int test_barrier_fsync(struct io_uring *ring)
io_uring_sqe_set_flags(sqe, IOSQE_IO_DRAIN);
ret = io_uring_submit(ring);
- if (ret < 5) {
- printf("Submitted only %d\n", ret);
- goto err;
- } else if (ret < 0) {
+ if (ret < 0) {
printf("sqe submit failed\n");
if (ret == EINVAL)
printf("kernel may not support barrier fsync yet\n");
goto err;
+ } else if (ret < 5) {
+ printf("Submitted only %d\n", ret);
+ goto err;
}
for (i = 0; i < 5; i++) {
diff --git a/test/nop.c b/test/nop.c
index 1373695..4b072fc 100644
--- a/test/nop.c
+++ b/test/nop.c
@@ -62,12 +62,12 @@ static int test_barrier_nop(struct io_uring *ring)
}
ret = io_uring_submit(ring);
- if (ret < 8) {
- printf("Submitted only %d\n", ret);
- goto err;
- } else if (ret < 0) {
+ if (ret < 0) {
printf("sqe submit failed: %d\n", ret);
goto err;
+ } else if (ret < 8) {
+ printf("Submitted only %d\n", ret);
+ goto err;
}
for (i = 0; i < 8; i++) {
diff --git a/test/stdout.c b/test/stdout.c
index 7b64c8c..b12d75c 100644
--- a/test/stdout.c
+++ b/test/stdout.c
@@ -28,12 +28,12 @@ static int test_pipe_io(struct io_uring *ring)
io_uring_prep_writev(sqe, STDOUT_FILENO, &vecs, 1, 0);
ret = io_uring_submit(ring);
- if (ret < 1) {
- printf("Submitted only %d\n", ret);
- goto err;
- } else if (ret < 0) {
+ if (ret < 0) {
printf("sqe submit failed: %d\n", ret);
goto err;
+ } else if (ret < 1) {
+ printf("Submitted only %d\n", ret);
+ goto err;
}
ret = io_uring_wait_cqe(ring, &cqe);