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 D3EDD439BB for ; Thu, 25 Jan 2024 03:35:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CBE3D4029B; Thu, 25 Jan 2024 03:35:54 +0100 (CET) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id CAA3740275; Thu, 25 Jan 2024 03:35:52 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4TL4fP6mZ6zXgdF; Thu, 25 Jan 2024 10:34:37 +0800 (CST) Received: from dggpeml500024.china.huawei.com (unknown [7.185.36.10]) by mail.maildlp.com (Postfix) with ESMTPS id 4203718001A; Thu, 25 Jan 2024 10:35:36 +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:35:20 +0800 Subject: Re: [PATCH v2 5/8] dmadev: fix calloc parameters To: Ferruh Yigit , Kevin Laatz , Bruce Richardson , =?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-5-ferruh.yigit@amd.com> From: fengchengwen Message-ID: <93a0ccbd-2389-774b-fb82-96b9d2f29212@huawei.com> Date: Thu, 25 Jan 2024 10:35:20 +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-5-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: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml500024.china.huawei.com (7.185.36.10) X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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_dmadev.a.p/dmadev_rte_dmadev.c.o > ../lib/dmadev/rte_dmadev.c: In function ‘dmadev_handle_dev_dump’: > ../lib/dmadev/rte_dmadev.c:1033:29: > warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier > argument and not in the later argument [-Wcalloc-transposed-args] > 1033 | buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN); > | ^~~~ > > Fixes: 94043b04212a ("dmadev: support telemetry dump dmadev") > Cc: stable@dpdk.org > > Signed-off-by: Ferruh Yigit > --- > Cc: fengchengwen@huawei.com > --- > lib/dmadev/rte_dmadev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c > index 5953a77bd6f9..c4e909270058 100644 > --- a/lib/dmadev/rte_dmadev.c > +++ b/lib/dmadev/rte_dmadev.c > @@ -1030,7 +1030,7 @@ dmadev_handle_dev_dump(const char *cmd __rte_unused, > if (*end_param != '\0') > RTE_DMA_LOG(WARNING, "Extra parameters passed to dmadev telemetry command, ignoring"); > > - 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; > >