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 D5CAE4326F; Thu, 2 Nov 2023 14:09:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C29AC402D5; Thu, 2 Nov 2023 14:09:00 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2071.outbound.protection.outlook.com [40.107.212.71]) by mails.dpdk.org (Postfix) with ESMTP id B778740282; Thu, 2 Nov 2023 14:08:58 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Obj4ZT845BtZvGySHdMik1BzW72XIGZZE3uVRHWvhKiIbxpqKenhI/zkXck4rUx7Ah7xuBBflr/5cRl5c6ci9VuWcLcNRkdRwdSMuQQ+PhyvPNYpB39WFFssPRmicCbi+wieYDNFLED5GFCDRhRlUruZ8yKFKcpusjc0btw43AGd1V74dzYErFokT2IDh5DnmYI9g4JqNNkuWn76FftAunSnNHWeLyYuvaVLjFa4lopm0klZKdsNbU9OlmY1o2BfsVknGnOsYyOpdDTOk3LO2CzP7c3DADuQRGmeoJmKsgFoVwkSqcWD/D4Ev/n6j3ep6BK2STHj4mqyo5zEyyqE3w== 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=/kA5u7JCPVlTVftsNgvHLmQuwd5zn1RyllLoJmqVvf0=; b=lVYdwqNDICL+dxdKWFzlKPFJgh49IyKnCVGWpinJHKRZqK/asDkOakAbmon/fGGqeFDKGkRzdf9N5g21EEANUj42hFeP/Uwhq4KY83CVHhDzpIHihF61+ihIhg7Ca/onPgCQIH2l98U0Xbp/Ihkxr6faJVFt1RaE79q4mEt2Fo1kcGldEvaljK8sh9/EdZ1mFV49FacQpBncy5Qif116wSXNMB48AGr5PJt3tk2TlpX9WSlfkywe1WpHirC7UO8o661w0O4e5fhCNM+gX8oJ7/dqkb4PRIUy0WBLxSelA9wwbk3Qtbn55SwmDtQw7n4pXx05c/j6B1P+j/WB+Cm1Mw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com 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 (0) 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=/kA5u7JCPVlTVftsNgvHLmQuwd5zn1RyllLoJmqVvf0=; b=aaeTf7TaNnP9RoGUzugfxX+xMzKqTRJK0wAa6XyxkUzlgzkPfC0fnwqKJHFHrf+kVaOX7bQcq0mYaSO+7bvo6fzb2DFbEeXSSVLQM8fXXAPo955Mlfpo5Fh/DIvmLX/KRgoIi7JgQjJPjo2vpRZIF/I5nydRvU0PN4flAXuEn4Q= Received: from DM6PR18CA0005.namprd18.prod.outlook.com (2603:10b6:5:15b::18) by IA0PR12MB8745.namprd12.prod.outlook.com (2603:10b6:208:48d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21; Thu, 2 Nov 2023 13:08:57 +0000 Received: from DS3PEPF000099D8.namprd04.prod.outlook.com (2603:10b6:5:15b:cafe::39) by DM6PR18CA0005.outlook.office365.com (2603:10b6:5:15b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.21 via Frontend Transport; Thu, 2 Nov 2023 13:08: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 DS3PEPF000099D8.mail.protection.outlook.com (10.167.17.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6954.19 via Frontend Transport; Thu, 2 Nov 2023 13:08:56 +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.2507.32; Thu, 2 Nov 2023 08:08:55 -0500 From: Ferruh Yigit To: Cristian Dumitrescu , Kamalakannan R CC: , Subject: [PATCH 1/2] pipeline: fix calloc parameters Date: Thu, 2 Nov 2023 13:08:46 +0000 Message-ID: <20231102130847.3367102-1-ferruh.yigit@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D8:EE_|IA0PR12MB8745:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f643b5d-a570-4151-7127-08dbdba4df2a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tLaLFlYF22e8DPo19Ywg668xV4VoItHNvLXqY2ddk1r+HHcjlpP+SQm1g3F0TJ3QSP5SAuAT0GaIOG8BYJfRYesnSh1geLXKS56/FlVEznssKgCle0qhiHv9WbKXly/C2DWczNxtGxyzKwAXHhvbywKuh+eTZjlxswzdZq4va3vsXJLp82msh08LSREMUoWzbXX+OhgI8p2iHeFiVOY+kOePBdT5RN/Wg143VHHPecA8Y6hPO6EEPRgr7T6KG5GNymq1tv4MZ1foUwWSDwY/iC/CePdoEiX7zThezcZ5TF1d6TuI+sCaodGYJ9+PQxk7/dObbcst/7aKZMxfJs3+ln4iWmmW6EXFdkQZwmBBa+3G6FEYy3sYw2qOovIeKuLy/1+3OtwvG3Hb2i3qKcPPL5gxj0zHnVVf6YuhXWqOrBl8efaBqlRxyGjVH7k9FARk0yvr5KUfpW451u2FGQTmtlWeEamZnc8n1yf0mr20Nyvxo96pzP+XLIou6FavzKZd5ao+eiBa0WEOsBPo8Z3THTQOcqwqhRNO4/8NzUI0Z3RjI13Fr6bOjltEPJYhSgDTquBSXl1uq7SUIakckg7E1thKd1HgfhECtVej6LPv0Ure+kZR9r/FG8nC9OQOLh7j7TbgLvpXrmpVAdDbDogyXC+OIhuUu++Gi1PnUKXTBlGO74dVCHmJk0ukVX3UuqmX5opXgQF+/3YcW+loBVEFuuKW+CJGjlnfj/JK1zqd/UCWJMkccl8f/Lg5I3FOr4dpx6XsvGylpx0M4xvnhxBGXbPeLF1QHTyO7alEF7X1lS19qV+9rS9dzt4r9vH6yYMW 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:(13230031)(4636009)(376002)(396003)(136003)(346002)(39860400002)(230273577357003)(230922051799003)(230173577357003)(82310400011)(1800799009)(186009)(64100799003)(451199024)(40470700004)(36840700001)(46966006)(40460700003)(426003)(47076005)(16526019)(26005)(1076003)(336012)(356005)(81166007)(36860700001)(110136005)(70586007)(316002)(70206006)(54906003)(5660300002)(8936002)(4326008)(8676002)(44832011)(6666004)(7696005)(2616005)(2906002)(478600001)(41300700001)(82740400003)(83380400001)(86362001)(36756003)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2023 13:08:56.6089 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f643b5d-a570-4151-7127-08dbdba4df2a 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: DS3PEPF000099D8.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8745 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 gcc [1] generates warning [2] about calloc usage, because calloc parameter order is wrong, fixing it by replacing parameters. [1] gcc (GCC) 14.0.0 20231102 (experimental) [2] Compiling C object .../pipeline_rte_swx_pipeline_spec.c.o .../rte_swx_pipeline_spec.c: In function ‘pipeline_spec_parse’: ../lib/pipeline/rte_swx_pipeline_spec.c:2893:11: warning: allocation of insufficient size ‘1’ for type ‘struct pipeline_spec’ with size ‘144’ [-Walloc-size] 2893 | s = calloc(sizeof(struct pipeline_spec), 1); | ^ .../rte_swx_pipeline_spec.c: In function ‘pipeline_iospec_parse’: ../lib/pipeline/rte_swx_pipeline_spec.c:4244:11: warning: allocation of insufficient size ‘1’ for type ‘struct pipeline_iospec’ with size ‘64’ [-Walloc-size] 4244 | s = calloc(sizeof(struct pipeline_iospec), 1); | ^ Fixes: 30c4abb90942 ("pipeline: rework specification file-based pipeline build") Fixes: 54cae37ef4ef ("pipeline: support I/O specification") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit --- Cc: cristian.dumitrescu@intel.com --- lib/pipeline/rte_swx_pipeline_spec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pipeline/rte_swx_pipeline_spec.c b/lib/pipeline/rte_swx_pipeline_spec.c index 2bba0d0524d0..17419e7b854b 100644 --- a/lib/pipeline/rte_swx_pipeline_spec.c +++ b/lib/pipeline/rte_swx_pipeline_spec.c @@ -2890,7 +2890,7 @@ pipeline_spec_parse(FILE *spec, } /* Memory allocation. */ - s = calloc(sizeof(struct pipeline_spec), 1); + s = calloc(1, sizeof(struct pipeline_spec)); if (!s) { if (err_line) *err_line = n_lines; @@ -4241,7 +4241,7 @@ pipeline_iospec_parse(FILE *spec, } /* Memory allocation. */ - s = calloc(sizeof(struct pipeline_iospec), 1); + s = calloc(1, sizeof(struct pipeline_iospec)); if (!s) { if (err_line) *err_line = n_lines; -- 2.34.1