From: Peter Huewe Date: Tue, 19 Feb 2013 04:18:50 +0000 (+0100) Subject: staging/slicoss: Fix operation may be undefined warning X-Git-Tag: v3.2.95~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b765188ad9753664fc87b74a7ef262cb5bea94d2;p=thirdparty%2Fkernel%2Fstable.git staging/slicoss: Fix operation may be undefined warning commit 6d1b80fd886937ad4d6169ffa78cb0075eebce53 upstream. 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 Signed-off-by: Greg Kroah-Hartman Signed-off-by: Ben Hutchings --- diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c index 77a0751a31ad8..f54057b3a6e5b 100644 --- a/drivers/staging/slicoss/slicoss.c +++ b/drivers/staging/slicoss/slicoss.c @@ -1490,7 +1490,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];