Commit a17ad921 authored by Ben Walker's avatar Ben Walker
Browse files

Replace RTE_VERIFY with assert



We already require the assert header from the C standard library,
so use that instead of RTE_VERIFY to further isolate DPDK
dependencies.

Change-Id: I4a718af858c88aff6080e33e6c3dd533c077b8f4
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 29004b67
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -112,8 +112,8 @@ struct spdk_bdev *spdk_bdev_get_by_name(const char *bdev_name)
static void
spdk_bdev_io_set_rbuf(struct spdk_bdev_io *bdev_io, void *buf)
{
	RTE_VERIFY(bdev_io->get_rbuf_cb != NULL);
	RTE_VERIFY(buf != NULL);
	assert(bdev_io->get_rbuf_cb != NULL);
	assert(buf != NULL);
	bdev_io->u.read.buf_unaligned = buf;
	bdev_io->u.read.buf = (void *)((unsigned long)((char *)buf + 512) & ~511UL);
	bdev_io->u.read.put_rbuf = true;
@@ -447,7 +447,7 @@ spdk_bdev_io_submit(struct spdk_bdev_io *bdev_io)
	if (bdev_io->status == SPDK_BDEV_IO_STATUS_PENDING) {
		cb_event = spdk_event_allocate(rte_lcore_id(), bdev_io->cb,
					       bdev_io->caller_ctx, bdev_io, NULL);
		RTE_VERIFY(cb_event != NULL);
		assert(cb_event != NULL);
	}

	__submit_request(bdev, bdev_io, cb_event);
@@ -791,7 +791,7 @@ spdk_bdev_io_complete(struct spdk_bdev_io *bdev_io, enum spdk_bdev_io_status sta

	bdev_io->status = status;

	RTE_VERIFY(bdev_io->cb_event != NULL);
	assert(bdev_io->cb_event != NULL);
	spdk_event_call(bdev_io->cb_event);
}

@@ -822,7 +822,7 @@ spdk_bdev_unregister(struct spdk_bdev *bdev)
void
spdk_bdev_io_get_rbuf(struct spdk_bdev_io *bdev_io, spdk_bdev_io_get_rbuf_cb cb)
{
	RTE_VERIFY(cb != NULL);
	assert(cb != NULL);

	if (bdev_io->u.read.buf == NULL) {
		bdev_io->get_rbuf_cb = cb;
+3 −4
Original line number Diff line number Diff line
@@ -33,11 +33,10 @@

#include "spdk/copy_engine.h"

#include <assert.h>
#include <stdio.h>
#include <errno.h>
#include <assert.h>
#include <rte_config.h>
#include <rte_debug.h>
#include <rte_memcpy.h>

#include "spdk/log.h"
@@ -59,14 +58,14 @@ struct copy_io_channel {
void
spdk_copy_engine_register(struct spdk_copy_engine *copy_engine)
{
	RTE_VERIFY(hw_copy_engine == NULL);
	assert(hw_copy_engine == NULL);
	hw_copy_engine = copy_engine;
}

static void
spdk_memcpy_register(struct spdk_copy_engine *copy_engine)
{
	RTE_VERIFY(mem_copy_engine == NULL);
	assert(mem_copy_engine == NULL);
	mem_copy_engine = copy_engine;
}

+3 −3
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
 *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include <assert.h>
#include <stdio.h>
#include <errno.h>

@@ -38,7 +39,6 @@
#include <rte_malloc.h>
#include <rte_memcpy.h>
#include <rte_lcore.h>
#include <rte_debug.h>

#include "spdk/copy_engine.h"
#include "spdk/vtophys.h"
@@ -168,7 +168,7 @@ ioat_copy_submit(void *cb_arg, struct spdk_io_channel *ch, void *dst, void *src,
	struct ioat_task *ioat_task = (struct ioat_task *)cb_arg;
	struct ioat_io_channel *ioat_ch = spdk_io_channel_get_ctx(ch);

	RTE_VERIFY(ioat_ch->ioat_ch != NULL);
	assert(ioat_ch->ioat_ch != NULL);

	ioat_task->cb = cb;

@@ -183,7 +183,7 @@ ioat_copy_submit_fill(void *cb_arg, struct spdk_io_channel *ch, void *dst, uint8
	struct ioat_io_channel *ioat_ch = spdk_io_channel_get_ctx(ch);
	uint64_t fill64 = 0x0101010101010101ULL * fill;

	RTE_VERIFY(ioat_ch->ioat_ch != NULL);
	assert(ioat_ch->ioat_ch != NULL);

	ioat_task->cb = cb;

+2 −2
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@

#include "spdk/event.h"

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
@@ -46,7 +47,6 @@
#include <signal.h>

#include <rte_config.h>
#include <rte_debug.h>
#include <rte_lcore.h>

#include "spdk/log.h"
@@ -246,7 +246,7 @@ spdk_app_init(struct spdk_app_opts *opts)
	}

	config = spdk_conf_allocate();
	RTE_VERIFY(config != NULL);
	assert(config != NULL);
	if (opts->config_file) {
		rc = spdk_conf_read(config, opts->config_file);
		if (rc != 0) {
+0 −1
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@
#include <string.h>
#include <unistd.h>

#include <rte_debug.h>
#include <rte_config.h>
#include <rte_per_lcore.h>
#include <rte_eal.h>
Loading