Date: Thu, 17 Jan 2013 18:52:50 +0000 (UTC) From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245567 - head/sys/dev/cxgbe Message-ID: <201301171852.r0HIqocu054073@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: np Date: Thu Jan 17 18:52:49 2013 New Revision: 245567 URL: http://svnweb.freebsd.org/changeset/base/245567 Log: cxgbe: Make the for_each macros safer to use by turning them into a single statement each. Submitted by: Christoph Mallon <christoph dot mallon at gmx dot de> MFC after: 1 week Modified: head/sys/dev/cxgbe/adapter.h Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Jan 17 18:45:20 2013 (r245566) +++ head/sys/dev/cxgbe/adapter.h Thu Jan 17 18:52:49 2013 (r245567) @@ -648,17 +648,17 @@ struct adapter { #define TXQ_LOCK_ASSERT_NOTOWNED(txq) EQ_LOCK_ASSERT_NOTOWNED(&(txq)->eq) #define for_each_txq(pi, iter, q) \ - q = &pi->adapter->sge.txq[pi->first_txq]; \ - for (iter = 0; iter < pi->ntxq; ++iter, ++q) + for (q = &pi->adapter->sge.txq[pi->first_txq], iter = 0; \ + iter < pi->ntxq; ++iter, ++q) #define for_each_rxq(pi, iter, q) \ - q = &pi->adapter->sge.rxq[pi->first_rxq]; \ - for (iter = 0; iter < pi->nrxq; ++iter, ++q) + for (q = &pi->adapter->sge.rxq[pi->first_rxq], iter = 0; \ + iter < pi->nrxq; ++iter, ++q) #define for_each_ofld_txq(pi, iter, q) \ - q = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq]; \ - for (iter = 0; iter < pi->nofldtxq; ++iter, ++q) + for (q = &pi->adapter->sge.ofld_txq[pi->first_ofld_txq], iter = 0; \ + iter < pi->nofldtxq; ++iter, ++q) #define for_each_ofld_rxq(pi, iter, q) \ - q = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq]; \ - for (iter = 0; iter < pi->nofldrxq; ++iter, ++q) + for (q = &pi->adapter->sge.ofld_rxq[pi->first_ofld_rxq], iter = 0; \ + iter < pi->nofldrxq; ++iter, ++q) /* One for errors, one for firmware events */ #define T4_EXTRA_INTR 2
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301171852.r0HIqocu054073>