Commit 0606eaad authored by Ben Walker's avatar Ben Walker
Browse files

No longer wrap assert()



assert is part of the C standard library and is available
on any platform we'd consider porting to. Don't put a
wrapper around it.

Change-Id: I0acfdd6a8a269d6c37df38fb7ddf4f1227630223
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 88801428
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -201,7 +201,7 @@ ioat_prep_copy(struct spdk_ioat_chan *ioat, uint64_t dst,
	struct ioat_descriptor *desc;
	union spdk_ioat_hw_desc *hw_desc;

	ioat_assert(len <= ioat->max_xfer_size);
	assert(len <= ioat->max_xfer_size);

	if (ioat_get_ring_space(ioat) < 1) {
		return NULL;
@@ -232,7 +232,7 @@ ioat_prep_fill(struct spdk_ioat_chan *ioat, uint64_t dst,
	struct ioat_descriptor *desc;
	union spdk_ioat_hw_desc *hw_desc;

	ioat_assert(len <= ioat->max_xfer_size);
	assert(len <= ioat->max_xfer_size);

	if (ioat_get_ring_space(ioat) < 1) {
		return NULL;
+1 −7
Original line number Diff line number Diff line
#ifndef __IOAT_IMPL_H__
#define __IOAT_IMPL_H__

#include <assert.h>
#include <pthread.h>
#include <stdio.h>
#include <stdbool.h>
@@ -11,6 +10,7 @@
#include <rte_atomic.h>
#include <rte_cycles.h>

#include "spdk/assert.h"
#include "spdk/pci.h"
#include "spdk/vtophys.h"
#include "spdk/pci.h"
@@ -64,12 +64,6 @@ ioat_zmalloc(const char *tag, size_t size, unsigned align, uint64_t *phys_addr)
 */
#define ioat_delay_us(us)        rte_delay_us(us)

/**
 * Assert a condition and panic/abort as desired.  Failures of these
 *  assertions indicate catastrophic failures within the driver.
 */
#define ioat_assert(check)		assert(check)

/**
 * Log or print a message from the driver.
 */
+2 −2
Original line number Diff line number Diff line
@@ -150,8 +150,8 @@ nvme_allocate_request_null(spdk_nvme_cmd_cb cb_fn, void *cb_arg)
void
nvme_free_request(struct nvme_request *req)
{
	nvme_assert(req != NULL, ("nvme_free_request(NULL)\n"));
	nvme_assert(req->num_children == 0, ("num_children != 0\n"));
	assert(req != NULL);
	assert(req->num_children == 0);

	nvme_dealloc_request(req);
}
+1 −1
Original line number Diff line number Diff line
@@ -902,7 +902,7 @@ nvme_ctrlr_process_init(struct spdk_nvme_ctrlr *ctrlr)
		break;

	default:
		nvme_assert(0, ("unhandled ctrlr state %d\n", ctrlr->state));
		assert(0);
		nvme_ctrlr_fail(ctrlr);
		return -1;
	}
+0 −6
Original line number Diff line number Diff line
@@ -104,12 +104,6 @@ nvme_malloc(const char *tag, size_t size, unsigned align, uint64_t *phys_addr)
 */
#define nvme_printf(ctrlr, fmt, args...) printf(fmt, ##args)

/**
 * Assert a condition and panic/abort as desired.  Failures of these
 *  assertions indicate catastrophic failures within the driver.
 */
#define nvme_assert(check, str) assert(check)

/**
 * Return the physical address for the specified virtual address.
 */
Loading