From patchwork Tue Oct 17 11:31:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 132741 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2407B4318A; Tue, 17 Oct 2023 13:31:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F07284029E; Tue, 17 Oct 2023 13:31:34 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 1603640273 for ; Tue, 17 Oct 2023 13:31:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697542293; 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; bh=d+oFTZL/RvDAvAf14OagRA0mE2t30K6f6lplmUft+AU=; b=dqvGT8eKSg4CBVai4afr+myNoX6Ai/zKdQJ2h4eJnTr8FvuYMiKA2s6+oJ3vklsQA6yD8y 9USyNjfs+Hz64EpKnwE++0FBTQVRdv2KbScGb648i+xethQWYaX8ZUHEaNlhD3r5eO1QUF T95OcvL7NOgMZZlFTO5NEUmSRLiwx38= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-54-3oB6vfXhPOSCg08rZkuU7A-1; Tue, 17 Oct 2023 07:31:30 -0400 X-MC-Unique: 3oB6vfXhPOSCg08rZkuU7A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F2FB128EC105; Tue, 17 Oct 2023 11:31:29 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.225.182]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D0E82026D6F; Tue, 17 Oct 2023 11:31:29 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, roretzla@linux.microsoft.com Subject: [PATCH] devtools: extend check on compiler builtin atomics Date: Tue, 17 Oct 2023 13:31:25 +0200 Message-ID: <20231017113125.2990147-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 rte_memory_order_* should be used when calling the new stdatomic API. Add a check on __ATOMIC_* tokens. Signed-off-by: David Marchand Acked-by: Tyler Retzlaff --- devtools/checkpatches.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index 2635923e14..7740152643 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -113,9 +113,9 @@ check_forbidden_additions() { # # refrain from using compiler __atomic_xxx builtins awk -v FOLDERS="lib drivers app examples" \ - -v EXPRESSIONS="__atomic_.*\\\(" \ + -v EXPRESSIONS="__atomic_.*\\\( __ATOMIC_(RELAXED|CONSUME|ACQUIRE|RELEASE|ACQ_REL|SEQ_CST)" \ -v RET_ON_FAIL=1 \ - -v MESSAGE='Using __atomic_xxx built-ins, prefer rte_atomic_xxx' \ + -v MESSAGE='Using __atomic_xxx/__ATOMIC_XXX built-ins, prefer rte_atomic_xxx' \ -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ "$1" || res=1