sched: fix build with debug enabled

Message ID 20211107163054.2745624-1-alialnu@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series sched: fix build with debug enabled |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Ali Alnubani Nov. 7, 2021, 4:30 p.m. UTC
  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")
Cc: wojciechx.liguzinski@intel.com

Signed-off-by: Ali Alnubani <alialnu@nvidia.com>
---
 lib/sched/rte_pie.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Nov. 7, 2021, 5:50 p.m. UTC | #1
07/11/2021 17:30, Ali Alnubani:
> 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")
> Cc: wojciechx.liguzinski@intel.com
> 
> Signed-off-by: Ali Alnubani <alialnu@nvidia.com>

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

Patch

diff --git a/lib/sched/rte_pie.h b/lib/sched/rte_pie.h
index a3441ffe51..dfdf572311 100644
--- a/lib/sched/rte_pie.h
+++ b/lib/sched/rte_pie.h
@@ -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++;