staging/slicoss: Fix operation may be undefined warning
authorPeter Huewe <peterhuewe@gmx.de>
Tue, 19 Feb 2013 04:18:50 +0000 (05:18 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Mar 2013 16:22:44 +0000 (09:22 -0700)
gcc complains about an undefined operation:
slicoss.c:1417:19: warning: operation on 'rspq->pageindex' may be
undefined [-Wsequence-point]

The intended operation was (probably) to retrieve the pageindex + 1 and let
it wrap around if it reaches the num_pages.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/slicoss/slicoss.c

index 048a341..fc08585 100644 (file)
@@ -1414,7 +1414,7 @@ static struct slic_rspbuf *slic_rspqueue_getnext(struct adapter *adapter)
                slic_reg64_write(adapter, &adapter->slic_regs->slic_rbar64,
                        (rspq->paddr[rspq->pageindex] | SLIC_RSPQ_BUFSINPAGE),
                        &adapter->slic_regs->slic_addr_upper, 0, DONT_FLUSH);
-               rspq->pageindex = (++rspq->pageindex) % rspq->num_pages;
+               rspq->pageindex = (rspq->pageindex + 1) % rspq->num_pages;
                rspq->offset = 0;
                rspq->rspbuf = (struct slic_rspbuf *)
                                                rspq->vaddr[rspq->pageindex];