There should be no reason to call ctf_msg_iter_seek if there is no seek
callback. It's the user of the ctf_msg_iter who passes medium
operations (at creation time), so it should be aware if there is a seek
callback or not.
This allows removing the UNSUPPORTED values in enum ctf_msg_iter_status
and enum ctf_msg_iter_medium_status.
Change-Id: Ic3591b1e909c7cf0e12d18f40b921a180cf344c8
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
BT_ASSERT(msg_it);
BT_ASSERT(offset >= 0);
-
- if (!msg_it->medium.medops.seek) {
- status = CTF_MSG_ITER_STATUS_UNSUPPORTED;
- BT_COMP_LOGD("Aborting seek as the iterator's underlying media does not implement seek support.");
- goto end;
- }
+ BT_ASSERT(msg_it->medium.medops.seek);
medium_status = msg_it->medium.medops.seek(offset, msg_it->medium.data);
if (medium_status != CTF_MSG_ITER_MEDIUM_STATUS_OK) {
*/
CTF_MSG_ITER_MEDIUM_STATUS_AGAIN = 11,
- /** Unsupported operation. */
- CTF_MSG_ITER_MEDIUM_STATUS_UNSUPPORTED = -3,
-
/** General error. */
CTF_MSG_ITER_MEDIUM_STATUS_ERROR = -1,
*/
CTF_MSG_ITER_STATUS_AGAIN = CTF_MSG_ITER_MEDIUM_STATUS_AGAIN,
- /** Unsupported operation. */
- CTF_MSG_ITER_STATUS_UNSUPPORTED = CTF_MSG_ITER_MEDIUM_STATUS_UNSUPPORTED,
-
/** General error. */
CTF_MSG_ITER_STATUS_ERROR = CTF_MSG_ITER_MEDIUM_STATUS_ERROR,