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 1861345BC0; Thu, 24 Oct 2024 14:05:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 119394344F; Thu, 24 Oct 2024 14:05:56 +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 6B8244344B for ; Thu, 24 Oct 2024 14:05:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729771554; 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=CwhMw2aEZQ+ZAvurrh/A3yltzMU3uAmnRZEOa7hdez0=; b=RwSXUrfITeXEoyl0wHIw89FWsShTh9rGVL5lPU8BFLTXze0NRThdZQspygVdds0UKtB9Q/ AumHPl0oq5EnRdbQV1nSO1ORifN+ioRjkmH69HieoEndLGKizdcruokQ77quqmTcAu/b/e jASzciic1nXvlZGZ3y5sp/RWjtzLnoE= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-456-Z71sj7gJP7mgxndviIybAg-1; Thu, 24 Oct 2024 08:05:52 -0400 X-MC-Unique: Z71sj7gJP7mgxndviIybAg-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 44D98195420E; Thu, 24 Oct 2024 12:05:51 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.57]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 12AE630001A6; Thu, 24 Oct 2024 12:05:48 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@amd.com, stephen@networkplumber.org, mattias.ronnblom@ericsson.com Subject: [PATCH 2/6] devtools: forbid use of builtin helpers Date: Thu, 24 Oct 2024 14:05:31 +0200 Message-ID: <20241024120535.2722316-3-david.marchand@redhat.com> In-Reply-To: <20241024120535.2722316-1-david.marchand@redhat.com> References: <20241024120535.2722316-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 Warn on use of any __builtin helpers, but leave it open for EAL (as it is where the abstractions for OS and compiler differences are), and some drivers base code. Signed-off-by: David Marchand --- devtools/checkpatches.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index d860f19045..4a8591be22 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -177,11 +177,12 @@ check_forbidden_additions() { # -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ "$1" || res=1 - # forbid use of non abstracted bit count operations + # forbid use of compiler __builtin_* awk -v FOLDERS="lib drivers app examples" \ - -v EXPRESSIONS='\\<__builtin_(clz|ctz|ffs|popcount)(ll)?\\>' \ + -v SKIP_FILES='lib/eal/ drivers/.*/base/ drivers/.*osdep.h$' \ + -v EXPRESSIONS='\\<__builtin_' \ -v RET_ON_FAIL=1 \ - -v MESSAGE='Using __builtin helpers for bit count operations' \ + -v MESSAGE='Using __builtin helpers, prefer EAL macros' \ -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ "$1" || res=1 -- 2.46.2