[v2,02/10] bus/dpaa: fix the BE compilation issue

Message ID 1519889597-5805-3-git-send-email-hemant.agrawal@nxp.com
State Superseded
Headers show
Series
  • meson build support for dpaaX
Related show

Commit Message

Hemant March 1, 2018, 7:33 a.m.
The array pointers were used without index.

Fixes: b9083ea5e084 ("net/dpaa: further push mode optimizations")
Cc: stable@dpdk.org

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

---
 drivers/bus/dpaa/base/qbman/qman.c        | 5 +++--
 drivers/bus/dpaa/base/qbman/qman_driver.c | 5 +----
 2 files changed, 4 insertions(+), 6 deletions(-)

-- 
2.7.4

Comments

Shreyansh Jain March 1, 2018, 12:22 p.m. | #1
On Thu, Mar 1, 2018 at 1:03 PM, Hemant Agrawal <hemant.agrawal@nxp.com> wrote:
>

> The array pointers were used without index.

>

> Fixes: b9083ea5e084 ("net/dpaa: further push mode optimizations")

> Cc: stable@dpdk.org

>

> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>

> ---

>  drivers/bus/dpaa/base/qbman/qman.c        | 5 +++--

>  drivers/bus/dpaa/base/qbman/qman_driver.c | 5 +----

>  2 files changed, 4 insertions(+), 6 deletions(-)

>


Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>

Patch

diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c
index 2b97671..2810fdd 100644
--- a/drivers/bus/dpaa/base/qbman/qman.c
+++ b/drivers/bus/dpaa/base/qbman/qman.c
@@ -1087,7 +1087,7 @@  unsigned int qman_portal_poll_rx(unsigned int poll_limit,
 		shadow[rx_number]->fd.opaque =
 			be32_to_cpu(dq[rx_number]->fd.opaque);
 #else
-		shadow = dq;
+		shadow[rx_number] = dq[rx_number];
 #endif
 
 		/* SDQCR: context_b points to the FQ */
@@ -1095,7 +1095,8 @@  unsigned int qman_portal_poll_rx(unsigned int poll_limit,
 		fq[rx_number] = qman_fq_lookup_table[be32_to_cpu(
 						dq[rx_number]->contextB)];
 #else
-		fq[rx_number] = (void *)(uintptr_t)be32_to_cpu(dq->contextB);
+		fq[rx_number] = (void *)be32_to_cpu(
+						dq[rx_number]->contextB);
 #endif
 		fq[rx_number]->cb.dqrr_prepare(shadow[rx_number],
 						 &bufs[rx_number]);
diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c
index 7cfa8ee..66838d2 100644
--- a/drivers/bus/dpaa/base/qbman/qman_driver.c
+++ b/drivers/bus/dpaa/base/qbman/qman_driver.c
@@ -246,7 +246,6 @@  int fsl_qman_portal_destroy(struct qman_portal *qp)
 int qman_global_init(void)
 {
 	const struct device_node *dt_node;
-	int ret = 0;
 	size_t lenp;
 	const u32 *chanid;
 	static int ccsr_map_fd;
@@ -352,9 +351,7 @@  int qman_global_init(void)
 		qman_clk = be32_to_cpu(*clk);
 
 #ifdef CONFIG_FSL_QMAN_FQ_LOOKUP
-	ret = qman_setup_fq_lookup_table(CONFIG_FSL_QMAN_FQ_LOOKUP_MAX);
-	if (ret)
-		return ret;
+	return qman_setup_fq_lookup_table(CONFIG_FSL_QMAN_FQ_LOOKUP_MAX);
 #endif
 	return 0;
 }