drivers: net: fsl_mc: Compare pointer value qbman_swp_mc_start
authorPratiyush Mohan Srivastava <pratiyush.srivastava@freescale.com>
Tue, 22 Dec 2015 11:20:19 +0000 (16:50 +0530)
committerYork Sun <york.sun@nxp.com>
Mon, 25 Jan 2016 16:24:17 +0000 (08:24 -0800)
Current code compares the return pointer of function
qbman_cena_write_start with NULL. Instead the value of the return
pointer should be compared.

Signed-off-by: Pratiyush Mohan Srivastava <pratiyush.srivastava@freescale.com>
Acked-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
drivers/net/fsl-mc/dpio/qbman_portal.c

index 449ff8a8ba3235515c07120df4b35b788743d6bd..4b64c8ae73f3e69f7d84f7ff2ca5dcf1216e0261 100644 (file)
@@ -102,12 +102,14 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d)
 void *qbman_swp_mc_start(struct qbman_swp *p)
 {
        void *ret;
+       int *return_val;
 #ifdef QBMAN_CHECKING
        BUG_ON(p->mc.check != swp_mc_can_start);
 #endif
        ret = qbman_cena_write_start(&p->sys, QBMAN_CENA_SWP_CR);
 #ifdef QBMAN_CHECKING
-       if (!ret)
+       return_val = (int *)ret;
+       if (!(*return_val))
                p->mc.check = swp_mc_can_submit;
 #endif
        return ret;