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 B3DE542814; Wed, 22 Mar 2023 22:48:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9248F40A84; Wed, 22 Mar 2023 22:48:21 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 5989640395 for ; Wed, 22 Mar 2023 22:48:20 +0100 (CET) Content-class: urn:content-classes:message Subject: RE: [PATCH] devtools: stop compiler atomics with no C11 equivalent MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Wed, 22 Mar 2023 22:48:17 +0100 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D877EB@smartserver.smartshare.dk> X-MimeOLE: Produced By Microsoft Exchange V6.5 In-Reply-To: <20230322210015.GA4644@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] devtools: stop compiler atomics with no C11 equivalent Thread-Index: AdldAU/m5fDySVAfTIuGwiG6jd0GzAAAyemQ References: <1679329321-26073-1-git-send-email-roretzla@linux.microsoft.com> <20230322180819.GB28785@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <98CBD80474FA8B44BF855DF32C47DC35D877EA@smartserver.smartshare.dk> <20230322210015.GA4644@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Tyler Retzlaff" Cc: , , , 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 > From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com] > Sent: Wednesday, 22 March 2023 22.00 >=20 > On Wed, Mar 22, 2023 at 07:25:09PM +0100, Morten Br=F8rup wrote: > > > From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com] > > > Sent: Wednesday, 22 March 2023 19.08 > > > > > > adding a few more people to cc for attention > > > > > > On Mon, Mar 20, 2023 at 09:22:01AM -0700, Tyler Retzlaff wrote: > > > > Refrain from using compiler > __atomic_{add,and,nand,or,sub,xor}_fetch() > > > > to ease future adoption of C11 standard atomics. > > > > > > > > Signed-off-by: Tyler Retzlaff > > > > --- > > > > devtools/checkpatches.sh | 8 ++++++++ > > > > 1 file changed, 8 insertions(+) > > > > > > > > diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh > > > > index 1dee094..1ed6d51 100755 > > > > --- a/devtools/checkpatches.sh > > > > +++ b/devtools/checkpatches.sh > > > > @@ -119,6 +119,14 @@ check_forbidden_additions() { # > > > > -f $(dirname $(readlink -f $0))/check-forbidden- > tokens.awk > > > \ > > > > "$1" || res=3D1 > > > > > > > > + # refrain from using compiler > > > __atomic_{add,and,nand,or,sub,xor}_fetch() > > > > + awk -v FOLDERS=3D"lib drivers app examples" \ > > > > + -v > > > EXPRESSIONS=3D"__atomic_(add|and|nand|or|sub|xor)_fetch\\\(" \ > > > > + -v RET_ON_FAIL=3D1 \ > > > > + -v MESSAGE=3D'Using > __atomic_{add,and,nand,or,sub,xor}_fetch' > > > \ > > > > Suggest that you expand the error message with a solution for the > developer: "... use __atomic_fetch_op() instead of = __atomic_op_fetch()" >=20 > if awk could expand captures i would do that but it can't. >=20 > or do you mean literally use 'op' instead of {add,and,nand,or,sub,xor} > in the message? I didn't think about expansion, so literally using "op" in the solution = part of the message is exactly what I meant. But please keep the = existing part of the message as is. Alternatively, you can also use "{add,and,nand,or,sub,xor}" instead of = "op" in the solution part of the message. Whatever you prefer. The message could be even more verbose by also adding the reason why = __atomic_op_fetch() is prohibited, such as: "... in order to prepare for = conversion to C11 stdatomics, where = atomic_{add,and,nand,or,sub,xor}_fetch() is unavailable." >=20 > > > > > > + -f $(dirname $(readlink -f $0))/check-forbidden- > tokens.awk > > > \ > > > > + "$1" || res=3D1 > > > > + > > > > # forbid use of __reserved which is a reserved keyword in > Windows > > > system headers > > > > awk -v FOLDERS=3D"lib drivers app examples" \ > > > > -v EXPRESSIONS=3D'\\<__reserved\\>' \ > > > > -- > > > > 1.8.3.1