devtools: suppress checkpatch warning on some kernel macro
PATCH 1/1 devtools: suppress checkpatch warning on some kernel macro
Kernel checkpatch.pl is confused about RTE_BUILD_BUG_ON() and warns as if our code was calling the kernel macro BUG_ON().
This does not make sense in the DPDK userspace code and the Linux kernel module hosted in our repository (kernel/linux/kni) won't make it upstream.
Disable this warning.
--- devtools/checkpatches.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
devtools/checkpatches.sh +1 -1
@@ -33,7 +33,7 @@ VOLATILE,PREFER_PACKED,PREFER_ALIGNED,PREFER_PRINTF,STRLCPY,\ PREFER_KERNEL_TYPES,PREFER_FALLTHROUGH,BIT_MACRO,CONST_STRUCT,\ SPLIT_STRING,LONG_LINE_STRING,C99_COMMENT_TOLERANCE,\ LINE_SPACING,PARENTHESIS_ALIGNMENT,NETWORKING_BLOCK_COMMENT_STYLE,\ -NEW_TYPEDEFS,COMPARISON_TO_NULL" +NEW_TYPEDEFS,COMPARISON_TO_NULL,AVOID_BUG" options="$options $DPDK_CHECKPATCH_OPTIONS" print_usage () {
Signature · 1 line
2.39.2
Quoted 9 lines · David Marchand
Kernel checkpatch.pl is confused about
RTE_BUILD_BUG_ON()and warns as if our code was calling the kernel macroBUG_ON().This does not make sense in the DPDK userspace code and the Linux kernel module hosted in our repository (
kernel/linux/kni) won't make it upstream.Disable this warning.
Signed-off-by David Marchand <[email protected]>
Sounds reasonable,
Is there any occurrence in the public CI, as reference?
Quoted 10 lines · Ferruh Yigit
Quoted 8 lines · David Marchand
Kernel checkpatch.pl is confused about
RTE_BUILD_BUG_ON()and warns as if our code was calling the kernel macroBUG_ON().This does not make sense in the DPDK userspace code and the Linux kernel module hosted in our repository (
kernel/linux/kni) won't make it upstream.Disable this warning.
Quoted 7 lines
Quoted 1 line
Signed-off-by David Marchand <[email protected]>Sounds reasonable,
Acked-by Ferruh Yigit <[email protected]>Is there any occurrence in the public CI, as reference?
I caught it when preparing submission of:
https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/
dpdk.org checkpath did not catch it, so it is probably lagging a bit.
For reference, in my environment, this looks like:
### [PATCH] malloc: rework heap destroy
WARNING:AVOID_BUG: Do not crash the kernel unless it is absolutely unavoidable--use WARN_ON_ONCE() plus recovery code (if feasible) instead of BUG() or variants
#23: FILE: lib/eal/common/malloc_heap.c:1389:
+ RTE_BUILD_BUG_ON(offsetof(struct malloc_heap, lock) != 0);
total: 0 errors, 1 warnings, 23 lines checked
0/1 valid patch
Signature · 1 line
David Marchand
Thomas Monjalon
Applied04/04/2023 15:00, Ferruh Yigit:
Quoted 7 lines · David Marchand
Quoted 6 lines
Kernel checkpatch.pl is confused about
RTE_BUILD_BUG_ON()and warns as if our code was calling the kernel macroBUG_ON().This does not make sense in the DPDK userspace code and the Linux kernel module hosted in our repository (
kernel/linux/kni) won't make it upstream.
Quoted 6 lines
Quoted 3 lines
Disable this warning.
Signed-off-by David Marchand <[email protected]>Sounds reasonable,
Acked-by Ferruh Yigit <[email protected]>
Applied, thanks.