From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by dpdk.org (Postfix) with ESMTP id E14FE235; Tue, 31 Jul 2018 09:51:55 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 023F480D; Tue, 31 Jul 2018 00:51:55 -0700 (PDT) Received: from net-debian.shanghai.arm.com (net-debian.shanghai.arm.com [10.169.36.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 550863F5BA; Tue, 31 Jul 2018 00:51:54 -0700 (PDT) From: Gavin Hu To: dev@dpdk.org Cc: gavin.hu@arm.com, stable@dpdk.org Date: Tue, 31 Jul 2018 15:51:37 +0800 Message-Id: <20180731075137.15413-1-gavin.hu@arm.com> X-Mailer: git-send-email 2.11.0 Subject: [dpdk-stable] [PATCH] net/dpaa2: remove unnecessary loop for unused pool entries X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jul 2018 07:51:56 -0000 Currently only one buffer pool is configured and in use, looping for up to maxmum 8 times is unnecessary and might be buggy as assigned uninititalized values. The fix is to loop for the configured times with initialize with valid values. Fixes: 16bbc98a3e ("bus/fslmc: update MC to 10.3.x") Cc: stable@dpdk.org Signed-off-by: Gavin Hu Reviewed-by: Honnappa Nagarahalli --- drivers/net/dpaa2/mc/dpni.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dpaa2/mc/dpni.c b/drivers/net/dpaa2/mc/dpni.c index 69cf119ce..9f228169a 100644 --- a/drivers/net/dpaa2/mc/dpni.c +++ b/drivers/net/dpaa2/mc/dpni.c @@ -198,7 +198,7 @@ int dpni_set_pools(struct fsl_mc_io *mc_io, token); cmd_params = (struct dpni_cmd_set_pools *)cmd.params; cmd_params->num_dpbp = cfg->num_dpbp; - for (i = 0; i < DPNI_MAX_DPBP; i++) { + for (i = 0; i < cmd_params->num_dpbp; i++) { cmd_params->pool[i].dpbp_id = cpu_to_le16(cfg->pools[i].dpbp_id); cmd_params->pool[i].priority_mask = -- 2.11.0