net/bnxt: fix compilation error with some compilers

Message ID 20190614042057.37389-1-ajit.khaparde@broadcom.com (mailing list archive)
State Accepted, archived
Headers
Series net/bnxt: fix compilation error with some compilers |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing fail Performance Testing issues
ci/Intel-compilation fail Compilation issues

Commit Message

Ajit Khaparde June 14, 2019, 4:20 a.m. UTC
  The driver was defining its own version of roundup which was
conflicting with another version defined elsewhere.

Change the local definition of roundup to avoid compilation errors.

Fixes: c5d09af8aa46 ("net/bnxt: support thor controller")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Thomas Monjalon June 14, 2019, 6:56 a.m. UTC | #1
14/06/2019 13:20, Ajit Khaparde:
> The driver was defining its own version of roundup which was
> conflicting with another version defined elsewhere.
> 
> Change the local definition of roundup to avoid compilation errors.
> 
> Fixes: c5d09af8aa46 ("net/bnxt: support thor controller")

Fixed the wrong reference to
Fixes: f8168ca0e690 ("net/bnxt: support thor controller")

> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

Applied, thanks
  

Patch

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 5f9c096a7..8fc510351 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -3545,7 +3545,7 @@  static void bnxt_free_ctx_mem(struct bnxt *bp)
 	bp->ctx = NULL;
 }
 
-#define roundup(x, y)   ((((x) + ((y) - 1)) / (y)) * (y))
+#define bnxt_roundup(x, y)   ((((x) + ((y) - 1)) / (y)) * (y))
 
 #define min_t(type, x, y) ({                    \
 	type __min1 = (x);                      \
@@ -3612,7 +3612,7 @@  int bnxt_alloc_ctx_mem(struct bnxt *bp)
 		return rc;
 
 	entries = ctx->qp_max_l2_entries;
-	entries = roundup(entries, ctx->tqm_entries_multiple);
+	entries = bnxt_roundup(entries, ctx->tqm_entries_multiple);
 	entries = clamp_t(uint32_t, entries, ctx->tqm_min_entries_per_ring,
 			  ctx->tqm_max_entries_per_ring);
 	for (i = 0, ena = 0; i < BNXT_MAX_Q; i++) {