[PATCH v2] eal/arm: replace RTE_BUILD_BUG on non-constant
Morten Brørup
mb at smartsharesystems.com
Tue Oct 8 11:47:56 CEST 2024
> From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> Sent: Friday, 4 October 2024 19.47
>
> On Fri, 3 May 2024 19:27:30 +0100
> Daniel Gregory <daniel.gregory at bytedance.com> wrote:
>
> > Fix the compile errors by replacing the check with an assert, like in
> > the generic implementation (lib/eal/include/generic/rte_pause.h).
> > - RTE_BUILD_BUG_ON(memorder != rte_memory_order_acquire &&
> > + assert(memorder != rte_memory_order_acquire &&
> > memorder != rte_memory_order_relaxed);
> >
>
> Why not change RET_BUILD_BUG_ON() to RTE_ASSERT()?
> The one issue is that by default RTE_ENABLE_ASSERT is not enabled.
I don't like assert() either. RTE_ASSERT() should be used instead.
However, there should be no objections to doing exactly the same as in the generic implementation.
A replacement of assert() throughout the DPDK code would be a different patch.
Checkpatch could check for it too.
For this patch,
Reviewed-by: Morten Brørup <mb at smartsharesystems.com>
More information about the dev
mailing list