Thread (4 messages) 4 messages, 4 authors, 19d ago
COLD19d

[PATCH] devtool: fix falsely reporting from checkpatch

From: WanRenyong <hidden>
Date: 2025-01-20 11:27:12
Subsystem: the rest · Maintainer: Linus Torvalds

When executes the check_packed_attributes function in checkpatch,
if __rte_packed_begin or __rte_packed_end appear in the context
of a patch file, there may be a situation where the counts of
__rte_packed_begin and __rte_packed_end do not match, causing
checkpatch to return a failure.
This patch fixes this issue by only counting the lines in the
patch file that start with a + and include either
__rte_packed_begin or __rte_packed_end.

Signed-off-by: WanRenyong <redacted>
---
 devtools/checkpatches.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 003bb49e04..2e228b7f92 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -384,8 +384,8 @@ check_packed_attributes() { # <patch>
 		res=1
 	fi
 
-	begin_count=$(grep '__rte_packed_begin' "$1" | wc -l)
-	end_count=$(grep '__rte_packed_end' "$1" | wc -l)
+	begin_count=$(grep -E '^\+.*__rte_packed_begin' "$1" | wc -l)
+	end_count=$(grep -E '^\+.*__rte_packed_end' "$1" | wc -l)
 	if [ $begin_count != $end_count ]; then
 		echo "__rte_packed_begin and __rte_packed_end should always be used in pairs."
 		res=1
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help