bus/dpaa: fix big endian build
authorHemant Agrawal <hemant.agrawal@nxp.com>
Wed, 14 Mar 2018 07:55:58 +0000 (13:25 +0530)
committerBruce Richardson <bruce.richardson@intel.com>
Thu, 15 Mar 2018 16:40:13 +0000 (17:40 +0100)
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>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
drivers/bus/dpaa/base/qbman/qman.c
drivers/bus/dpaa/base/qbman/qman_driver.c

index 2b97671..2810fdd 100644 (file)
@@ -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]);
index 7cfa8ee..66838d2 100644 (file)
@@ -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;
 }