Cleanup: ctf: logically dead code
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 10 Oct 2019 15:11:06 +0000 (11:11 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 17 Oct 2019 16:13:26 +0000 (12:13 -0400)
The `iter_status` variable is guaranteed to be equal to
`BT_MSG_ITER_STATUS_OK` when breaking from the `do-while` loop above.

Coverity report:
  CID 1401337 (#1 of 1): Logically dead code (DEADCODE) dead_error_line:
  Execution cannot reach this statement: goto error;

Reported-by: Coverity (1401337) - Logically dead code
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I51448d800b8ed37e80ce64b77df3905c8042b1bf
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2166
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
src/plugins/ctf/fs-src/data-stream-file.c

index 924a2be788c5fe9b450862d82118005537ecdd2b..4f2c8375f5b32efe1e15eb0474ccd302f80cfced 100644 (file)
@@ -547,7 +547,7 @@ struct ctf_fs_ds_index *build_index_from_stream_file(
                goto error;
        }
 
-       do {
+       while (true) {
                off_t current_packet_size_bytes;
                struct ctf_fs_ds_index_entry *index_entry;
                struct bt_msg_iter_packet_properties props;
@@ -617,11 +617,6 @@ struct ctf_fs_ds_index *build_index_from_stream_file(
                        "next-packet-offset=%jd",
                        (intmax_t) (current_packet_offset_bytes - current_packet_size_bytes),
                        (intmax_t) current_packet_offset_bytes);
-
-       } while (iter_status == BT_MSG_ITER_STATUS_OK);
-
-       if (iter_status != BT_MSG_ITER_STATUS_OK) {
-               goto error;
        }
 
 end:
This page took 0.025327 seconds and 4 git commands to generate.