From: "WanRenyong" <wanry@yunsilicon.com>
To: <dev@dpdk.org>
Cc: <thomas@monjalon.net>, "WanRenyong" <wanry@yunsilicon.com>
Subject: [PATCH] devtool: fix falsely reporting from checkpatch
Date: Mon, 20 Jan 2025 19:26:54 +0800 [thread overview]
Message-ID: <20250120112654.1049456-1-wanry@yunsilicon.com> (raw)
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 <wanry@yunsilicon.com>
---
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
reply other threads:[~2025-01-20 11:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250120112654.1049456-1-wanry@yunsilicon.com \
--to=wanry@yunsilicon.com \
--cc=dev@dpdk.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).