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 66B8742A4D; Wed, 3 May 2023 11:51:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 40F634114B; Wed, 3 May 2023 11:51:03 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2084.outbound.protection.outlook.com [40.107.94.84]) by mails.dpdk.org (Postfix) with ESMTP id B20C741144 for ; Wed, 3 May 2023 11:51:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dp6RjUb6vGrNi/UQtNemgVeYVUiv/SIjTgsPlg7EZZ+WDs2MMuXQvOe+LTn7M6Fg71hdniuA7om/LG9AXhzAjkyfyNYY9oiGgxWcKb/0Uzx629B8a7DFO+/o49xsoLLJXKDI6OlD8bPQX0MVvL3GbzogtmL1Ks/1yIGsP+KG3/X0MpoUyBJGNF9On/O5QJkC3pAm83rfdVwjPTlXAZsMNSrdAb83vJM8HBtp1OSC2PHe0/xiS4cYlCN2xWPaafio9aKXwJ4wbdO29jABnOGV+LoyTL6NYGhS9J4epO45kktqQnH3eMkWCbC5WD1AdTawiSIhYei8RRBeRw3DD7d7Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ec+Se0siYkRCsv94YJSS76/MaJ0sS0+EGZCQoA0otnY=; b=JZmBu2PkCg0KH9C60vySHaFWZ1PU8oBd9eHf146HkRNEiUgZZvLNbfsvIKhEjJUMdRJvNLQT5A9/1fEnGfiN9Ylj3p5b7mdDGHeVAIA+po5Tt5OABCPrfdew1kTTHlD76UjtaGLivmWeGMV/H2sGyU21B8sOi24PA/juO4//V7UuAbplCBjf91K3QY7VAE9tkCVYIRlPslwW59FkEZRmtQmnYPHkKwffdMxnxOAScBIB4dONP7hg5r+MMnAQZ4gA6gKNf77aV94A0j6TJ571fRFeQGUcU2Cqj0SjGgnIpC0JGG8ne76P5GJcl5ZfquGK5n2gVj5+BCP1bFyPCJuRLA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=monjalon.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ec+Se0siYkRCsv94YJSS76/MaJ0sS0+EGZCQoA0otnY=; b=fTu15uJzt8f1DjZ/DhVVV6zfSW0LujxNa7DW3WcFWC0JJhzoGifrh8CLWWhH2igoPxa8so0Irw5cCkOGY5I9v4FFvuyOQ2uyfsvM2Y0oNQcszbFhj+AJaM8FXqkLctO9LGLppbykAJ6wzUj+Q/UkYI3H2NgFboR7DRwpjorLQls= Received: from MW4PR02CA0004.namprd02.prod.outlook.com (2603:10b6:303:16d::19) by DM8PR12MB5430.namprd12.prod.outlook.com (2603:10b6:8:28::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.22; Wed, 3 May 2023 09:50:56 +0000 Received: from CO1NAM11FT032.eop-nam11.prod.protection.outlook.com (2603:10b6:303:16d:cafe::48) by MW4PR02CA0004.outlook.office365.com (2603:10b6:303:16d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.22 via Frontend Transport; Wed, 3 May 2023 09:50:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT032.mail.protection.outlook.com (10.13.174.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6363.21 via Frontend Transport; Wed, 3 May 2023 09:50:55 +0000 Received: from telcodpdk.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 3 May 2023 04:50:54 -0500 From: Ferruh Yigit To: Thomas Monjalon CC: , Bruce Richardson , David Marchand Subject: [PATCH v1] devtools: allow variable declaration inside for loop Date: Wed, 3 May 2023 10:50:18 +0100 Message-ID: <20230503095018.1710769-1-ferruh.yigit@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT032:EE_|DM8PR12MB5430:EE_ X-MS-Office365-Filtering-Correlation-Id: 9da01918-6954-45bb-48ae-08db4bbbe3da X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5aZ1euqOz7+VLrjR++o3mHGRAiv3pLw6d64hFoIi74+HRPWTnxELj7NQAb5V3kY/5t8UdB9fT/nHxs1LEx0mX1XL84d8uqkHaA59Juz46zNIzId8FE+wDggUvRAVK8w7Va9iSn6TK0Q9VYrPWSV0hSkaRnCbokivhNPtrQa32mG6JmGUOH0e5Jxmoiz0ha2tH2QKkTCQRcsge9+9IkoLTAj1FdzuUQSIzw03k3AYBLrupqTRd9GoYMeeK1Edhajj1+AQDM28R/cUaNB+vcTLvO48kxYygeFqUVtscTIlx1L6UO+Gw5tBdcjWZDwPJKATzJRb7ysDlpyq7RG4rSTzLzEifyVyiQAR+tlOxjQ9HaDF/zVmA+nzSUDi781bwT4yqm63m9oNyvpzQDeFvF+Zoz53bgSraw2oShGYMrH8YJO/XX+bYdp6PpSUGs8IiTEzIdOKj37eRsAKlSFOEiwoJXTw97m230TYrbH5Tp8t7gcGnOvElTfL6xXlAGBUp9BMwjij+7rIwylsEfNadXbVxvjinIzcKHjuafu09nTVqlXiE8rHqHXbWtOVdJ8wkYSQCZTSAMb2tlKeHGelXs96wmMTscaohdG6GLTtlcZdNgTiFFdBq+cdaksTGNE0W5uTIQMn3lvuuTKRrJvvpbz68pjJtli+Fbe/emwTgF02S5s3B1Mafty6+JwhAdLQ795PqBBdL+PRaQ9ON2J1Czng0DxpuL3dgoDBXW7wEaphHel+8I3fnYwlYq/xiqqw5XUn X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230028)(4636009)(376002)(346002)(396003)(39860400002)(136003)(451199021)(46966006)(40470700004)(36840700001)(83380400001)(16526019)(47076005)(2616005)(86362001)(7696005)(186003)(36860700001)(54906003)(336012)(426003)(2906002)(26005)(1076003)(44832011)(5660300002)(70586007)(966005)(70206006)(40460700003)(82310400005)(6916009)(4326008)(8676002)(8936002)(6666004)(82740400003)(36756003)(40480700001)(81166007)(316002)(478600001)(356005)(41300700001)(21314003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 May 2023 09:50:55.5039 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9da01918-6954-45bb-48ae-08db4bbbe3da X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT032.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5430 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 Declaring variable inside for loop is not supported via C89 and it was checked in checkpatch.sh via commit [1]. But as DPDK supported C standard is becoming C99 [2], declaring variable inside loop can be allowed. [1] Commit 43e73483a4b8 ("devtools: forbid variable declaration inside for") [2] https://dpdk.org/patch/121912 Signed-off-by: Ferruh Yigit --- Cc: Bruce Richardson Cc: David Marchand --- devtools/checkpatches.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index 15d5d6709445..b5baf6f2b161 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -78,14 +78,6 @@ check_forbidden_additions() { # -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ "$1" || res=1 - # forbid variable declaration inside "for" loop - awk -v FOLDERS='.' \ - -v EXPRESSIONS='for[[:space:]]*\\((char|u?int|unsigned|s?size_t)' \ - -v RET_ON_FAIL=1 \ - -v MESSAGE='Declaring a variable inside for()' \ - -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ - "$1" || res=1 - # refrain from new additions of 16/32/64 bits rte_atomicNN_xxx() awk -v FOLDERS="lib drivers app examples" \ -v EXPRESSIONS="rte_atomic[0-9][0-9]_.*\\\(" \ -- 2.34.1