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 B15A9439BB; Thu, 25 Jan 2024 03:35:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9947340E78; Thu, 25 Jan 2024 03:35:10 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 6A9E54029B; Thu, 25 Jan 2024 03:35:08 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4TL4dX6F6lzXgZK; Thu, 25 Jan 2024 10:33:52 +0800 (CST) Received: from dggpeml500024.china.huawei.com (unknown [7.185.36.10]) by mail.maildlp.com (Postfix) with ESMTPS id 2FBD218007E; Thu, 25 Jan 2024 10:34:51 +0800 (CST) Received: from [10.67.121.161] (10.67.121.161) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 25 Jan 2024 10:34:50 +0800 Subject: Re: [PATCH v2 4/8] eventdev: fix calloc parameters To: Ferruh Yigit , Jerin Jacob , =?UTF-8?Q?Morten_Br=c3=b8rup?= CC: , References: <20231102130847.3367102-1-ferruh.yigit@amd.com> <20240124185406.3598985-1-ferruh.yigit@amd.com> <20240124185406.3598985-4-ferruh.yigit@amd.com> From: fengchengwen Message-ID: <0ff05849-6759-5cdc-447d-3c4a78a56790@huawei.com> Date: Thu, 25 Jan 2024 10:34:50 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20240124185406.3598985-4-ferruh.yigit@amd.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.121.161] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500024.china.huawei.com (7.185.36.10) 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 Reviewed-by: Chengwen Feng Thanks On 2024/1/25 2:54, Ferruh Yigit wrote: > gcc [1] generates warning [2] about calloc usage, because calloc > parameter order is wrong, fixing it by replacing parameters. > > [1] > gcc (GCC) 14.0.1 20240124 (experimental) > > [2] > Compiling C object lib/librte_eventdev.a.p/eventdev_rte_eventdev.c.o > ../lib/eventdev/rte_eventdev.c: In function ‘handle_dev_dump’: > ../lib/eventdev/rte_eventdev.c:2005:29: > warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier > argument and not in the later argument [-Wcalloc-transposed-args] > 2005 | buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN); > | ^~~~ > > Fixes: a3b7b476d723 ("eventdev: support telemetry dump eventdev") > Cc: stable@dpdk.org > > Signed-off-by: Ferruh Yigit > --- > Cc: fengchengwen@huawei.com > --- > lib/eventdev/rte_eventdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c > index 157752868d5b..1c865e993fec 100644 > --- a/lib/eventdev/rte_eventdev.c > +++ b/lib/eventdev/rte_eventdev.c > @@ -2002,7 +2002,7 @@ handle_dev_dump(const char *cmd __rte_unused, > > RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); > > - buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN); > + buf = calloc(RTE_TEL_MAX_SINGLE_STRING_LEN, sizeof(char)); > if (buf == NULL) > return -ENOMEM; > >