1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-22 11:17:19 +00:00

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
This commit is contained in:
Navdeep Parhar 2013-01-17 18:52:49 +00:00
parent 39804bc89d
commit e13fe79820
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245567

View File

@ -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