Commit a7b62cc4 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

nbd, nvmf: fix clang 4.0 packed member warnings



clang 4.0 introduced a new warning, -Waddress-of-packed-member, which
triggers on a couple of spots in NBD and NVMf. Fix them up to silence
the warnings.

Change-Id: I134618f93528ea9a3d08050c34056670a58abdab
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/377441


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 3dfd4a7c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -221,7 +221,10 @@ process_request(struct spdk_nbd_disk *nbd)
		return -ENOMEM;
	}

	assert(from_be32(&io->req.magic) == NBD_REQUEST_MAGIC);
	if (from_be32(&io->req.magic) != NBD_REQUEST_MAGIC) {
		SPDK_ERRLOG("invalid request magic\n");
		return -EINVAL;
	}

	switch (from_be32(&io->req.type)) {
	case NBD_CMD_READ:
+2 −1
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@
#include "nvmf_internal.h"
#include "transport.h"

#include "spdk/endian.h"
#include "spdk/io_channel.h"
#include "spdk/trace.h"
#include "spdk/nvme_spec.h"
@@ -831,7 +832,7 @@ spdk_nvmf_ctrlr_identify_ctrlr(struct spdk_nvmf_ctrlr *ctrlr, struct spdk_nvme_c
	spdk_strcpy_pad(cdata->subnqn, subsystem->subnqn, sizeof(cdata->subnqn), '\0');

	SPDK_DEBUGLOG(SPDK_TRACE_NVMF, "ctrlr data: maxcmd 0x%x\n", cdata->maxcmd);
	SPDK_DEBUGLOG(SPDK_TRACE_NVMF, "sgls data: 0x%x\n", *(uint32_t *)&cdata->sgls);
	SPDK_DEBUGLOG(SPDK_TRACE_NVMF, "sgls data: 0x%x\n", from_le32(&cdata->sgls));

	/*
	 * NVM subsystem fields (reserved for discovery subsystems)