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 169A7439BB; Thu, 25 Jan 2024 03:34:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A7B44029B; Thu, 25 Jan 2024 03:34:10 +0100 (CET) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id 210A140275; Thu, 25 Jan 2024 03:34:08 +0100 (CET) Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4TL4cl65KLz1xmjx; Thu, 25 Jan 2024 10:33:11 +0800 (CST) Received: from dggpeml500024.china.huawei.com (unknown [7.185.36.10]) by mail.maildlp.com (Postfix) with ESMTPS id 016AF140594; Thu, 25 Jan 2024 10:34:05 +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:04 +0800 Subject: Re: [PATCH v2 3/8] rawdev: fix calloc parameters To: Ferruh Yigit , Sachin Saxena , Hemant Agrawal , =?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-3-ferruh.yigit@amd.com> From: fengchengwen Message-ID: <7efeb7c7-decd-6b3d-ff6f-4121022811ea@huawei.com> Date: Thu, 25 Jan 2024 10:34:04 +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-3-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: dggems704-chm.china.huawei.com (10.3.19.181) 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.0 20240108 (experimental) > > [2] > Compiling C object .../lib/librte_rawdev.a.p/rawdev_rte_rawdev.c.o > ../lib/rawdev/rte_rawdev.c: In function ‘handle_dev_dump’: > ../lib/rawdev/rte_rawdev.c:659:29: > error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier > argument and not in the later argument > [-Werror=calloc-transposed-args] > 659 | buf = calloc(sizeof(char), RTE_TEL_MAX_SINGLE_STRING_LEN); > | ^~~~ > > Fixes: e915d404eb72 ("rawdev: support telemetry dump rawdev") > Cc: stable@dpdk.org > > Signed-off-by: Ferruh Yigit > --- > Cc: fengchengwen@huawei.com > --- > lib/rawdev/rte_rawdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/rawdev/rte_rawdev.c b/lib/rawdev/rte_rawdev.c > index 474bdc95407f..4f8897b63947 100644 > --- a/lib/rawdev/rte_rawdev.c > +++ b/lib/rawdev/rte_rawdev.c > @@ -656,7 +656,7 @@ handle_dev_dump(const char *cmd __rte_unused, > if (!rte_rawdev_pmd_is_valid_dev(dev_id)) > return -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; > >