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 C25B446140; Tue, 28 Jan 2025 16:02:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D05440E37; Tue, 28 Jan 2025 16:02:48 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id CCDD740E44 for ; Tue, 28 Jan 2025 16:02:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738076566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gWpQNl06wVnb1HSwjq2+qIuLrFjUIOapf+CUk77XwhU=; b=BG8xYVwaCWKTqUnKLqni63SkQeRJofi9KFyZ6zijMk3CkWwNgoNPrRmsSs7lxr8W7SbRqw cZe/g3+3gHnZYLnrxL5QKL0Ysw4N/lW2zTBo13Bp9Aikj8Je3gw7Z1CEYc7bu+Mjip+7UQ 8OPrb4bk+txMMjxCMUM7MtH4pKvrhDc= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-685-zmPVHfF4NTavW_oBLKn_4g-1; Tue, 28 Jan 2025 10:02:45 -0500 X-MC-Unique: zmPVHfF4NTavW_oBLKn_4g-1 X-Mimecast-MFC-AGG-ID: zmPVHfF4NTavW_oBLKn_4g Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-30232891c1fso20875251fa.2 for ; Tue, 28 Jan 2025 07:02:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738076560; x=1738681360; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gWpQNl06wVnb1HSwjq2+qIuLrFjUIOapf+CUk77XwhU=; b=dOWO7HDXJA6QOCxjDDven+VSzX0lXg6iYfeVVgwMxem+KMZ/54lscRriOpvYtMAff0 eISC6raKUy1ye4o6X7MBvb/+4aPIM0khQGas8nz1e6UEzQyZRYmI+ZlSTB0fuhmwdMqd oHFp3OWbUQy7aKQOni5MJz3T61iUauPVq+xd7S3qIEEK5mykU/jGTkNlxmXLuFvysb79 ywiHSSGWurO/Czi5NfB32U51m6fAo/6J2LVw6dasouKqltH9ISHQZg9STov97OnzBDUD SHld/lss+S0+JPcG/VAh9QkBRN3HLtgDO+kr0tGt8r6focBEbdoukL96lzEsfcNjylfH Gn8g== X-Gm-Message-State: AOJu0YxmHdZxwxfHFM145SZD2gSi+vhpitfohxrvYri68h8//moGx7YT TRKOT6J+8d6DbO9FgvvLePuHuvEuXMN7S/jnmApf5Zi1OtJyI5Ov2qh8Z4tW1s92p/CVt29Tq2w e5G6vcMVSoTloK6ANmzXJPkSZQS8VtYWldQwLyrO1p1wJMvlA9jMTiMq3AXCTssMDDGggYSctns 0rKCmW/qT2msGkzck= X-Gm-Gg: ASbGncsMGFVN4Crr6kRO2UC3BpBLFb3pz4Ix+jc8O+nbzvRjgdrut8UOFDn5FcPZVno xSpOlR4ybhM+Se9znBPZpSbKmpZ7h/9Ewn5d9sX3+9tUjEMd0E52aB9YZZOiPp/WF X-Received: by 2002:a05:651c:4111:b0:307:5879:e7e6 with SMTP id 38308e7fff4ca-3075879ea24mr64763651fa.32.1738076559633; Tue, 28 Jan 2025 07:02:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGgQBTMf+50jP+jL4RIzaG1jTYGQyB0zyrH2XV9McuqsyK+lxkNFWzQ49AxiAox6i+p+QHZrAokyEc0aK58TA= X-Received: by 2002:a05:651c:4111:b0:307:5879:e7e6 with SMTP id 38308e7fff4ca-3075879ea24mr64763031fa.32.1738076558926; Tue, 28 Jan 2025 07:02:38 -0800 (PST) MIME-Version: 1.0 References: <20250120112654.1049456-1-wanry@yunsilicon.com> In-Reply-To: <20250120112654.1049456-1-wanry@yunsilicon.com> From: David Marchand Date: Tue, 28 Jan 2025 16:02:27 +0100 X-Gm-Features: AWEUYZn8H_bJ4gs-zf6c31USKT7PZAvo2Baiz8xx1c4cmHkHr8Y9Yl6AfLBNmY4 Message-ID: Subject: Re: [PATCH] devtool: fix falsely reporting from checkpatch To: WanRenyong Cc: dev@dpdk.org, thomas@monjalon.net, Andre Muezerie , Akhil Goyal X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: QTKZ9LdW1euzMIV1Sd4QsSCeFvhs6b4jInoXOcpDVz0_1738076560 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Hi, On Mon, Jan 20, 2025 at 12:27=E2=80=AFPM WanRenyong = wrote: > > 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 Thanks for proposing this fix. When sending such fixes, don't forget to add a Fixes: and Cc: author/maintainers by using --cc-cmd devtools/get-maintainers.sh Adding Akhil, Andr=C3=A9 and Thomas in the loop. I also had some concern about the check: https://inbox.dpdk.org/dev/CAJFAV8w=3Ds1L-WYk+Qv-B+Mn6eAwKrB=3DGTz6hU--ZoLr= Jsz7=3DDQ@mail.gmail.com/ But I merged the check untouched as nobody else seemed to object. Checkpatch warnings are known to have false positive and such false positives are "filtered" by subtree maintainers. > --- > 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=3D1 > fi > > - begin_count=3D$(grep '__rte_packed_begin' "$1" | wc -l) > - end_count=3D$(grep '__rte_packed_end' "$1" | wc -l) > + begin_count=3D$(grep -E '^\+.*__rte_packed_begin' "$1" | wc -l) > + end_count=3D$(grep -E '^\+.*__rte_packed_end' "$1" | wc -l) > if [ $begin_count !=3D $end_count ]; then > echo "__rte_packed_begin and __rte_packed_end should alwa= ys be used in pairs." > res=3D1 I don't think this change is any better. There is a good chance that a patch touching just a first line of a structure definition won't come along a line touching the last line of the struct. My suggestion (if we want to avoid those non useful warning) would be to just remove the counting stuff in the check. Opinions? --=20 David Marchand