Skip to contentSkip to conversation

sched: fix build with debug enabled

PATCH Applied Ali Alnubani 2 participants 2 messages Nov 7, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched: fix build with debug enabled

Compare pkt_len to 0 instead of NULL to avoid the following build failure with debug mode enabled:
../lib/sched/rte_pie.h: In function 'rte_pie_enqueue_empty':
../lib/sched/rte_pie.h:125:21: error: comparison between pointer
and integer [-Werror]
RTE_ASSERT(pkt_len != NULL);

Bugzilla ID: 878

Fixes 44c730b0e379 ("sched: add PIE based congestion management")
---
 lib/sched/rte_pie.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/sched/rte_pie.h +1 -1
index a3441ffe51..dfdf572311 100644
@@ -122,7 +122,7 @@ rte_pie_enqueue_empty(const struct rte_pie_config *pie_cfg,
 	struct rte_pie *pie,
 	uint32_t pkt_len)
 {
-	RTE_ASSERT(pkt_len != NULL);
+	RTE_ASSERT(pkt_len != 0);
 
 	/* Update the PIE qlen parameter */
 	pie->qlen++;
Signature · 1 line
2.25.1
#1 lore raw

07/11/2021 17:30, Ali Alnubani:

Quoted 7 lines

Compare pkt_len to 0 instead of NULL to avoid the following build failure with debug mode enabled:
../lib/sched/rte_pie.h: In function 'rte_pie_enqueue_empty':
../lib/sched/rte_pie.h:125:21: error: comparison between pointer
and integer [-Werror]
RTE_ASSERT(pkt_len != NULL);

Quoted 5 lines

Bugzilla ID: 878

Fixes 44c730b0e379 ("sched: add PIE based congestion management")

Applied, thanks Ali.
I expect a lot more fixes in this lib, given the poor review.