Commit 9e60b74b authored by Jacek Kalwas's avatar Jacek Kalwas Committed by Tomasz Zawadzki
Browse files

nvme: add un(likely) to validate functions



Change-Id: I1e180721f345a4c27c03f7f7d47ef6c80e57dcd9
Signed-off-by: default avatarJacek Kalwas <jacek.kalwas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21912


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 4aac5547
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ _nvme_ns_cmd_split_request(struct spdk_nvme_ns *ns,
static inline bool
_is_io_flags_valid(uint32_t io_flags)
{
	if (io_flags & ~SPDK_NVME_IO_FLAGS_VALID_MASK) {
	if (spdk_unlikely(io_flags & ~SPDK_NVME_IO_FLAGS_VALID_MASK)) {
		/* Invalid io_flags */
		SPDK_ERRLOG("Invalid io_flags 0x%x\n", io_flags);
		return false;
@@ -153,8 +153,12 @@ _is_accel_sequence_valid(struct spdk_nvme_qpair *qpair, void *seq)
{
	/* An accel sequence can only be executed if the controller supports accel and a qpair is
	 * part of a of a poll group */
	return seq == NULL || ((qpair->ctrlr->flags & SPDK_NVME_CTRLR_ACCEL_SEQUENCE_SUPPORTED) &&
			       qpair->poll_group != NULL);
	if (spdk_likely(seq == NULL || ((qpair->ctrlr->flags & SPDK_NVME_CTRLR_ACCEL_SEQUENCE_SUPPORTED) &&
					qpair->poll_group != NULL))) {
		return true;
	}

	return false;
}

static void