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 2CA8AA3160 for ; Fri, 11 Oct 2019 06:07:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 10F941E8E3; Fri, 11 Oct 2019 06:07:29 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 8CFD81E8B6 for ; Fri, 11 Oct 2019 06:07:27 +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 x9B46HMj021643 for ; Thu, 10 Oct 2019 21:07:27 -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=LttgPul1kD41kYSH6x7gxsL4d1spkteORJPi6Jo/0yh+qZrg9WmZVMTLrTe8nrXE+SpB c4lTEKrqZ0N09a6DBE5C/2zBQC37RTPSA/kHDIjtDQJF2rGSdLZtI+FI+/SbTdMVpcBe YWXPRY7Ftmy6a+a0h4xuDTat8keIhngwgAKJBvcVd4QPJ55hZlfDuSyNzHIQITNrb13I 45PTjQIGMxnp8xXpghnXtGxkerMOmnnucUosGIw/z5DurY0gadn4vtwEQwW7AYkhKQnU 9KrcKbpCCxCGKPjqiyfAvm4YqXfBoBiCpd0UF/a7fXMo0lnNGK0wlEfpYxe71PbmTtqf /g== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2vhdxc03a7-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 10 Oct 2019 21:07:26 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 10 Oct 2019 21:07:24 -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, 10 Oct 2019 21:07:24 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.84]) by maili.marvell.com (Postfix) with ESMTP id D6CBD3F703F; Thu, 10 Oct 2019 21:07:23 -0700 (PDT) From: To: CC: , Pavan Nikhilesh Date: Fri, 11 Oct 2019 09:37:08 +0530 Message-ID: <20191011040709.8344-3-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191011040709.8344-1-pbhagavatula@marvell.com> References: <20191011040709.8344-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-11_02:2019-10-10,2019-10-11 signatures=0 Subject: [dpdk-dev] [PATCH 3/3] 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