From patchwork Wed Jul 1 15:11:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 6001 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 89A725A29; Wed, 1 Jul 2015 17:11:41 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 32EFF2FDD for ; Wed, 1 Jul 2015 17:11:40 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 01 Jul 2015 08:11:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,386,1432623600"; d="scan'208";a="517248537" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by FMSMGA003.fm.intel.com with ESMTP; 01 Jul 2015 08:11:38 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t61FBbax026932; Wed, 1 Jul 2015 16:11:37 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t61FBbO4007302; Wed, 1 Jul 2015 16:11:37 +0100 Received: (from bricha3@localhost) by sivswdev01.ir.intel.com with id t61FBbJc007298; Wed, 1 Jul 2015 16:11:37 +0100 From: Bruce Richardson To: dev@dpdk.org Date: Wed, 1 Jul 2015 16:11:37 +0100 Message-Id: <1435763497-7264-1-git-send-email-bruce.richardson@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] cxgbe: fix compilation using icc X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When compiling the cxgbe driver with icc, multiple errors about using enums as integers appear across a number of files, including in the base code and in the DPDK-specific driver code. .../drivers/net/cxgbe/cxgbe_main.c(386): error #188: enumerated type mixed with another type t4_get_port_type_description(pi->port_type)); ^ For the errors in the base driver code we use the CFLAGS_BASE_DRIVER approach used by other drivers to disable warnings. For errors in the DPDK-specific code, typecasts are used to fix the errors in the code itself. Signed-off-by: Bruce Richardson --- drivers/net/cxgbe/Makefile | 17 +++++++++++++---- drivers/net/cxgbe/cxgbe_main.c | 5 +++-- drivers/net/cxgbe/sge.c | 3 ++- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/drivers/net/cxgbe/Makefile b/drivers/net/cxgbe/Makefile index ae12d75..0711976 100644 --- a/drivers/net/cxgbe/Makefile +++ b/drivers/net/cxgbe/Makefile @@ -49,7 +49,7 @@ ifeq ($(CC), icc) # # CFLAGS for icc # -CFLAGS_BASE_DRIVER = -wd174 -wd593 -wd869 -wd981 -wd2259 +CFLAGS_BASE_DRIVER = -wd188 else # # CFLAGS for gcc/clang @@ -57,18 +57,27 @@ else ifeq ($(shell test $(CC) = gcc && test $(GCC_VERSION) -ge 44 && echo 1), 1) CFLAGS += -Wno-deprecated endif -CFLAGS_BASE_DRIVER = -Wno-unused-parameter -Wno-unused-value -CFLAGS_BASE_DRIVER += -Wno-strict-aliasing -Wno-format-extra-args +CFLAGS_BASE_DRIVER = endif # +# Add extra flags for base driver files (also known as shared code) +# to disable warnings in them +# +BASE_DRIVER_OBJS=$(patsubst %.c,%.o,$(notdir $(wildcard $(SRCDIR)/base/*.c))) +$(foreach obj, $(BASE_DRIVER_OBJS), $(eval CFLAGS_$(obj)+=$(CFLAGS_BASE_DRIVER))) + +VPATH += $(SRCDIR)/base + + +# # all source are stored in SRCS-y # SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += cxgbe_main.c SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += sge.c -SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += base/t4_hw.c +SRCS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += t4_hw.c # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += lib/librte_eal lib/librte_ether diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c index dad0a98..b879820 100644 --- a/drivers/net/cxgbe/cxgbe_main.c +++ b/drivers/net/cxgbe/cxgbe_main.c @@ -383,7 +383,8 @@ static void print_port_info(struct adapter *adap) if (bufp != buf) --bufp; sprintf(bufp, "BASE-%s", - t4_get_port_type_description(pi->port_type)); + t4_get_port_type_description( + (enum fw_port_type)pi->port_type)); dev_info(adap, " " PCI_PRI_FMT " Chelsio rev %d %s %s\n", @@ -629,7 +630,7 @@ static int adap_init0(struct adapter *adap) dev_err(adap, "Failed to restart. Exit.\n"); goto bye; } - state &= ~DEV_STATE_INIT; + state = (enum dev_state)((unsigned)state & ~DEV_STATE_INIT); } t4_get_fw_version(adap, &adap->params.fw_vers); diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c index 4da6320..359296e 100644 --- a/drivers/net/cxgbe/sge.c +++ b/drivers/net/cxgbe/sge.c @@ -1670,7 +1670,8 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq, if (fl) { struct sge_eth_rxq *rxq = container_of(fl, struct sge_eth_rxq, fl); - enum chip_type chip = CHELSIO_CHIP_VERSION(adap->params.chip); + enum chip_type chip = (enum chip_type)CHELSIO_CHIP_VERSION( + adap->params.chip); /* * Allocate the ring for the hardware free list (with space