Commit 075d422f authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Tomasz Zawadzki
Browse files

build: enable Wpointer-arith in selected libraries

There's an organization, called Timerland SIG [1], that uses SPDK's NVMe
driver to implement NVMe Boot Specification under UEFI.  The UEFI EDK2
build environment uses both gcc and msvc.  While SPDK can be built
without any issues with gcc, msvc complains about a few things, one of
which is void pointer arithmetic.  So, to make Timberland's effort
easier, Wpointer-arith is enabled in the libraries they're using.

[1] https://github.com/timberland-sig



Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ic90330baa4e69ee72f7e040de91893093b96f476
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/18529


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent ebf9ccca
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -239,7 +239,7 @@ static inline void
_nvme_tcp_sgl_get_buf(struct spdk_iov_sgl *s, void **_buf, uint32_t *_buf_len)
{
	if (_buf != NULL) {
		*_buf = s->iov->iov_base + s->iov_offset;
		*_buf = (uint8_t *)s->iov->iov_base + s->iov_offset;
	}
	if (_buf_len != NULL) {
		*_buf_len = s->iov->iov_len - s->iov_offset;
+1 −1
Original line number Diff line number Diff line
@@ -260,7 +260,7 @@ spdk_sock_prep_req(struct spdk_sock_request *req, struct iovec *iovs, int index,
			continue;
		}

		iovs[iovcnt].iov_base = SPDK_SOCK_REQUEST_IOV(req, i)->iov_base + offset;
		iovs[iovcnt].iov_base = (uint8_t *)SPDK_SOCK_REQUEST_IOV(req, i)->iov_base + offset;
		iovs[iovcnt].iov_len = SPDK_SOCK_REQUEST_IOV(req, i)->iov_len - offset;
		if (num_bytes != NULL) {
			*num_bytes += iovs[iovcnt].iov_len;
+2 −0
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@ SO_SUFFIX := $(SO_VER).$(SO_MINOR)
C_SRCS = log.c log_flags.c log_deprecated.c
LIBNAME = log

CFLAGS += -Wpointer-arith

SPDK_MAP_FILE = $(abspath $(CURDIR)/spdk_log.map)

include $(SPDK_ROOT_DIR)/mk/spdk.lib.mk
+2 −0
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ ifeq ($(CONFIG_NVME_CUSE),y)
CFLAGS += -D_FILE_OFFSET_BITS=64
endif

CFLAGS += -Wpointer-arith

SPDK_MAP_FILE = $(abspath $(CURDIR)/spdk_nvme.map)

include $(SPDK_ROOT_DIR)/mk/spdk.lib.mk
+2 −2
Original line number Diff line number Diff line
@@ -4785,7 +4785,7 @@ spdk_nvme_ctrlr_update_firmware(struct spdk_nvme_ctrlr *ctrlr, void *payload, ui
	unsigned int				size_remaining;
	unsigned int				offset;
	unsigned int				transfer;
	void					*p;
	uint8_t					*p;

	if (!completion_status) {
		return -EINVAL;
@@ -5081,7 +5081,7 @@ nvme_write_boot_partition_cb(void *arg, const struct spdk_nvme_cpl *cpl)

	if (ctrlr->bp_ws == SPDK_NVME_BP_WS_DOWNLOADING) {
		NVME_CTRLR_DEBUGLOG(ctrlr, "Boot Partition Downloading at Offset %d Success\n", ctrlr->fw_offset);
		ctrlr->fw_payload += ctrlr->fw_transfer_size;
		ctrlr->fw_payload = (uint8_t *)ctrlr->fw_payload + ctrlr->fw_transfer_size;
		ctrlr->fw_offset += ctrlr->fw_transfer_size;
		ctrlr->fw_size_remaining -= ctrlr->fw_transfer_size;
		ctrlr->fw_transfer_size = spdk_min(ctrlr->fw_size_remaining, ctrlr->min_page_size);
Loading