From patchwork Thu Dec 13 15:02:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Lakkireddy X-Patchwork-Id: 48785 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 430421B579; Thu, 13 Dec 2018 16:04:14 +0100 (CET) Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8]) by dpdk.org (Postfix) with ESMTP id 4DF381B56D for ; Thu, 13 Dec 2018 16:04:12 +0100 (CET) Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id wBDF48SP007188; Thu, 13 Dec 2018 07:04:09 -0800 From: Rahul Lakkireddy To: dev@dpdk.org Cc: satishr@chelsio.com, indranil@chelsio.com Date: Thu, 13 Dec 2018 20:32:13 +0530 Message-Id: <1544713333-32239-5-git-send-email-rahul.lakkireddy@chelsio.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: <1544713333-32239-1-git-send-email-rahul.lakkireddy@chelsio.com> References: <1544713333-32239-1-git-send-email-rahul.lakkireddy@chelsio.com> Subject: [dpdk-dev] [PATCH 4/4] net/cxgbe: fix other misc build issues for Windows X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fix following build errors: warning: function declaration is incompatible with definition error : expected an expression error : expression must be a pointer to a complete object type Signed-off-by: Rahul Lakkireddy --- drivers/net/cxgbe/base/common.h | 2 +- drivers/net/cxgbe/cxgbe_compat.h | 14 +++++++------- drivers/net/cxgbe/sge.c | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/net/cxgbe/base/common.h b/drivers/net/cxgbe/base/common.h index 84311fc95..973d4d7dd 100644 --- a/drivers/net/cxgbe/base/common.h +++ b/drivers/net/cxgbe/base/common.h @@ -522,7 +522,7 @@ void t4_read_rss_key(struct adapter *adap, u32 *key); enum t4_bar2_qtype { T4_BAR2_QTYPE_EGRESS, T4_BAR2_QTYPE_INGRESS }; int t4_bar2_sge_qregs(struct adapter *adapter, unsigned int qid, - unsigned int qtype, u64 *pbar2_qoffset, + enum t4_bar2_qtype qtype, u64 *pbar2_qoffset, unsigned int *pbar2_qid); int t4_init_sge_params(struct adapter *adapter); diff --git a/drivers/net/cxgbe/cxgbe_compat.h b/drivers/net/cxgbe/cxgbe_compat.h index 686ca6e0a..edc8ea57d 100644 --- a/drivers/net/cxgbe/cxgbe_compat.h +++ b/drivers/net/cxgbe/cxgbe_compat.h @@ -276,12 +276,12 @@ static inline void writel_relaxed(unsigned int val, volatile void __iomem *addr) * Multiplies an integer by a fraction, while avoiding unnecessary * overflow or loss of precision. */ -#define mult_frac(x, numer, denom)( \ -{ \ - typeof(x) quot = (x) / (denom); \ - typeof(x) rem = (x) % (denom); \ - (quot * (numer)) + ((rem * (numer)) / (denom)); \ -} \ -) +static inline unsigned int mult_frac(unsigned int x, unsigned int numer, + unsigned int denom) +{ + unsigned int quot = x / denom; + unsigned int rem = x % denom; + return (quot * numer) + ((rem * numer) / denom); +} #endif /* _CXGBE_COMPAT_H_ */ diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c index bf0afb138..673c4fbb3 100644 --- a/drivers/net/cxgbe/sge.c +++ b/drivers/net/cxgbe/sge.c @@ -397,7 +397,8 @@ static unsigned int refill_fl_usembufs(struct adapter *adap, struct sge_fl *q, rte_mbuf_refcnt_set(mbuf, 1); mbuf->data_off = - (uint16_t)(RTE_PTR_ALIGN((char *)mbuf->buf_addr + + (uint16_t)((char *) + RTE_PTR_ALIGN((char *)mbuf->buf_addr + RTE_PKTMBUF_HEADROOM, adap->sge.fl_align) - (char *)mbuf->buf_addr);