From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3A2EBA317C for ; Thu, 17 Oct 2019 14:10:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D67881E8E3; Thu, 17 Oct 2019 14:10:15 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 1C72A1E8A6 for ; Thu, 17 Oct 2019 14:10:10 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9HC8sEH001325; Thu, 17 Oct 2019 05:10:08 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=o7JW96FcuzRgiJTtiClMFj3HW/bqxuV/fmvZSol2T2U=; b=jSPj4VkKUNCGyZ74Pjw7AGEGsLm2nC2pfqQvKx359alIv/71WX5PDRVnYycGChggqILG PQNQ8Lyr9ZvTHAAYIYFRSxs8YdEpezSTVzNVNp/s7fqTn1qLo3SVF4mZAfKKAvYBjouw tgcAMONtjl2dzBYZOM4PJLz9xsJfrrwPaZ+Bmkq/cfKIjSzhiNVoPxjWsnCYKPkI55wc berxl7zXBWP8VZi+wmZfrur6KkMTFJEOFSwB2dwpAMfsFMZ4NXQseJ+hjbUq5fvJ8fSz 1wMzDziY+YMSUl03dZFSP3PBXLeTNLgSvhgpHh07Mppc7M8H1KedZX3hDs0FRIWDdLTA bA== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2vpj9bs3gc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 17 Oct 2019 05:10:08 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 17 Oct 2019 05:10:06 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 17 Oct 2019 05:10:06 -0700 Received: from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255]) by maili.marvell.com (Postfix) with ESMTP id 411033F703F; Thu, 17 Oct 2019 05:10:05 -0700 (PDT) From: To: , CC: , Pavan Nikhilesh Date: Thu, 17 Oct 2019 17:40:00 +0530 Message-ID: <20191017121001.2546-2-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191017121001.2546-1-pbhagavatula@marvell.com> References: <20191011040709.8344-1-pbhagavatula@marvell.com> <20191017121001.2546-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-17_04:2019-10-17,2019-10-17 signatures=0 Subject: [dpdk-dev] [PATCH v2 2/2] bitrate: use RTE_DIM instead of ARRAY_SIZE X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Pavan Nikhilesh Use RTE_DIM instead of re-defining ARRAY_SIZE. Signed-off-by: Pavan Nikhilesh --- lib/librte_bitratestats/rte_bitrate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/librte_bitratestats/rte_bitrate.c b/lib/librte_bitratestats/rte_bitrate.c index 639e47547..d18152365 100644 --- a/lib/librte_bitratestats/rte_bitrate.c +++ b/lib/librte_bitratestats/rte_bitrate.c @@ -8,8 +8,6 @@ #include #include -#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) - /* * Persistent bit-rate data. * @internal @@ -50,7 +48,7 @@ rte_stats_bitrate_reg(struct rte_stats_bitrates *bitrate_data) if (bitrate_data == NULL) return -EINVAL; - return_value = rte_metrics_reg_names(&names[0], ARRAY_SIZE(names)); + return_value = rte_metrics_reg_names(&names[0], RTE_DIM(names)); if (return_value >= 0) bitrate_data->id_stats_set = return_value; return return_value; @@ -126,7 +124,7 @@ rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, values[4] = port_data->peak_ibits; values[5] = port_data->peak_obits; ret = rte_metrics_update_values(port_id, bitrate_data->id_stats_set, - values, ARRAY_SIZE(values)); + values, RTE_DIM(values)); if (ret < 0) return ret; -- 2.17.1