From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6F4E6460C2; Mon, 20 Jan 2025 12:27:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2AF0540653; Mon, 20 Jan 2025 12:27:12 +0100 (CET) Received: from lf-2-51.ptr.blmpb.com (lf-2-51.ptr.blmpb.com [101.36.218.51]) by mails.dpdk.org (Postfix) with ESMTP id D654D4027A for ; Mon, 20 Jan 2025 12:27:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=feishu2403070942; d=yunsilicon.com; t=1737372425; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=AFGgVENzomc8I5/69xJYp2IaModM8UYZmPQS3AjO5ls=; b=I0WeG+Y5Hb6OtMLT4t3woxjES1FWYOJ0U1vXpfLp3NoUmPKpFFbbxq7Knei0OHo0RBtEkB vi788VtHfpy7/S+Y4WgZ25euz4bx+GFRQesLu2wmlIgNBdRZzMbMMwHSJ7q+y0+ZvLz3AQ V321A3Exuri43kbpiykVxW9pC1EgowtY66KCnD/rgQe6QIwRrZ1A8ENRGivneMnHcmMaWv Fnwy9S88OYhSxMvRENq3mVzCHys+03IWpX9iymytenB9+j3VkIOrukxfNjfYTnb9qNaaHD GArFjbYOmuXAzGCZ9ZujRMdVZNDF2aCjZDIrh1vAxreRbQFp6WNtmwQgPSlCIw== To: Message-Id: <20250120112654.1049456-1-wanry@yunsilicon.com> Content-Transfer-Encoding: 7bit Cc: , "WanRenyong" From: "WanRenyong" X-Mailer: git-send-email 2.25.1 X-Lms-Return-Path: Subject: [PATCH] devtool: fix falsely reporting from checkpatch Date: Mon, 20 Jan 2025 19:26:54 +0800 Mime-Version: 1.0 X-Original-From: WanRenyong Received: from ubuntu-liun.yunsilicon.com ([58.34.192.114]) by smtp.feishu.cn with ESMTPS; Mon, 20 Jan 2025 19:27:02 +0800 Content-Type: text/plain; charset=UTF-8 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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() { # 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