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: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/377441
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Daniel Verkamp 2017-09-06 17:17:42 -07:00
parent 3dfd4a7c71
commit a7b62cc4cb
2 changed files with 6 additions and 2 deletions

View File

@ -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:

View File

@ -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)