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 188CC439B8; Wed, 24 Jan 2024 19:54:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 91D4D4027A; Wed, 24 Jan 2024 19:54:30 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2046.outbound.protection.outlook.com [40.107.237.46]) by mails.dpdk.org (Postfix) with ESMTP id 14B3D40262; Wed, 24 Jan 2024 19:54:29 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XMo0C90B/uY7I+wk/xoT/WFwPeg5xH26SwEbHjMT6ap5BSu8Y5AEYzv4AuBU/mrDsGFmF1JOk52kY4lfWrmXeze0+cKs4EPA3L52jquwMCG2iK75L4G46NQPimEWw6msaD5AoIEJjVBcSizzUXazpvbOAz0P5HUhC0bgBCvl68xTkx0FSCfJepmUuYDTEOp8cO2XwFfU9XPyL/6CQsobsrVITQ7TmzmKGWesc2SPrUGe8jI4b+FdSxDk7+2R+Ztn6kK/Dl6o26CkuoNakZQksI6W+FUyU5v942YbQtaj1acOapaHFscgT7pA6wLycJvbzinmpl0hGnTA4YHurXlaRA== 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=kplrD0S33HLygz4vlAJXMXefzehZ9GT5aQhV4OtnEpY=; b=Wgf6335vYl3FydI4fe+I4Ea403VJNk0IXS/X5Jx3CEkv00/vX/xh2oIYCVnynF1gOK9a0e5ThuCKD0hlWRC9KcXRU06L8ifSX7QUFw2I16GvGv4BCjLgxDTO3bi5zjiUpuxKloo/xhHburBmNtD1m5qbYXn/R4B2jQCgcjYQwUZhUM2xySGoyAa8kzvP4YoH6iw9AQ4fmtnz4kczofGBQa1an2fLL4BuUhPPfA+j1/SRGLT2tOIMHh66RKxVY4jMlZMXxCyHq+nS1hYgolJVuHnKZQSXwjZgKdtxYxbZSI6JYGpcMy1+l69yDFX4AQ3+NkQ7F4ZHcSyQJhF+z6GOFg== 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=kplrD0S33HLygz4vlAJXMXefzehZ9GT5aQhV4OtnEpY=; b=reCWrQpjLh+dLDXKejte6/HLV7y+EP29li85UeLS+1BKuga9KpmLrajdU2AWJevSOVc3NR0LMm/oAjfttfC1cah/OjV7NcO6Pn+/i266YLZv/tqSEFEPdow0Y+2OoDpbGGUnYb/exbTD4WFurwd7A9mRPgEMFK0/RUjrH8ltI6I= Received: from BYAPR01CA0019.prod.exchangelabs.com (2603:10b6:a02:80::32) by MN2PR12MB4093.namprd12.prod.outlook.com (2603:10b6:208:198::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Wed, 24 Jan 2024 18:54:27 +0000 Received: from SJ1PEPF00001CE9.namprd03.prod.outlook.com (2603:10b6:a02:80:cafe::5e) by BYAPR01CA0019.outlook.office365.com (2603:10b6:a02:80::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.38 via Frontend Transport; Wed, 24 Jan 2024 18:54:26 +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 SJ1PEPF00001CE9.mail.protection.outlook.com (10.167.242.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Wed, 24 Jan 2024 18:54:26 +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.34; Wed, 24 Jan 2024 12:54:24 -0600 From: Ferruh Yigit To: Cristian Dumitrescu , Kamalakannan R CC: , Subject: [PATCH v2 1/8] pipeline: fix calloc parameters Date: Wed, 24 Jan 2024 18:53:58 +0000 Message-ID: <20240124185406.3598985-1-ferruh.yigit@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231102130847.3367102-1-ferruh.yigit@amd.com> References: <20231102130847.3367102-1-ferruh.yigit@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit 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: SJ1PEPF00001CE9:EE_|MN2PR12MB4093:EE_ X-MS-Office365-Filtering-Correlation-Id: d257ab8d-64ee-404e-0e77-08dc1d0de339 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3e5Vtdq6zqPNS87E2p6lv92EdLkd7Np6T6wUdU+QVo2447gXhy3CJYkTbGlNI7k1mnLYXSwM5i/feRtIhCixsrtOnKzl32ghpj7iSRE0gix7cQ4VjXEQ82n1IeJEuz2eBcotiB6ZvXHlX09MV7vi5T7UU/4Xg4tWFL2rVjHn80QC23wvpfhXc+838BaL03QIJW6Ws4K/isfjPv8lOMG4dBDU0IBG9sjTGFWRpIW1o1vL61ogucBFSiSnN32voqpJ0/PTgkLYBxGt9m7bVPisprb93ZMrAFEgTu3fC2L2W7S58Mwp6atyV1Hcs2WKhHc4po4N4CBM9N6a4WbWctfGTwalF0/ZRfw993JiLKzS3COIsGGwYot6ch7Tlw1aq3U1DMO3YrvyFaC928pt5sZixVADhoQYvwzwn02PvOZs4vRdSUyLhATj+nlxJe2wfGVDhUcX8wj/H41ygjPFJ02T9hYD9a9rjUnFWXv87+pE6Uqn6qGl05B/PPUsSAKzZlFgC7IMpaau6GsViXVE5mT7vvn+yfmsiPM4mVaAtAStGeUpqlZLHGzbBbblRvT4CbH6vLTzqLQfCZgZXU/Sx/tGZzvjkPfXQ4DWj4E4ZrRdCZsE+L+/ZXqE8le2EkXlfNlE9RjrzkHXpiiHxuQaKizJ940V5AREYPnBCqWu5+GDN/wa4t83ui7tys53xrM/wl3eLUKpIaxJaefva+UxT8EDLNhgU9nUU4WmAWM26C4RCpqtys87frnkjFqqhe/JUTn3F8bMrMSbU2qIETR++SpyWI2eHbkNplqEb5wp0q6ioRJadhAErBThYVbfW3WYUFj0 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)(396003)(136003)(346002)(39860400002)(376002)(230922051799003)(230173577357003)(230273577357003)(451199024)(186009)(1800799012)(82310400011)(64100799003)(40470700004)(46966006)(36840700001)(4326008)(8676002)(8936002)(36756003)(2906002)(7696005)(426003)(336012)(83380400001)(44832011)(2616005)(16526019)(26005)(5660300002)(1076003)(110136005)(478600001)(86362001)(41300700001)(70586007)(70206006)(6666004)(54906003)(356005)(316002)(47076005)(81166007)(40480700001)(40460700003)(36860700001)(82740400003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2024 18:54:26.2309 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d257ab8d-64ee-404e-0e77-08dc1d0de339 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: SJ1PEPF00001CE9.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4093 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 Acked-by: Cristian Dumitrescu --- 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