summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>2005-04-13 01:32:06 +0000
committermdodd <mdodd@FreeBSD.org>2005-04-13 01:32:06 +0000
commit4d0827c51796ed790ac9b928d4ac6af0cac9e050 (patch)
tree116d44f5a3a01dba7773304be87ff74bb5fa5b83 /sys/pci
parentd3d78b9e76bbae47a8b252cdd9b96bd461f44aa2 (diff)
downloadFreeBSD-src-4d0827c51796ed790ac9b928d4ac6af0cac9e050.zip
FreeBSD-src-4d0827c51796ed790ac9b928d4ac6af0cac9e050.tar.gz
Invert conditional and use continue to reduce nesting.
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_pcn.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/sys/pci/if_pcn.c b/sys/pci/if_pcn.c
index 6305e29..00607242 100644
--- a/sys/pci/if_pcn.c
+++ b/sys/pci/if_pcn.c
@@ -1007,22 +1007,22 @@ pcn_encap(sc, m_head, txidx)
cur = frag = *txidx;
for (m = m_head; m != NULL; m = m->m_next) {
- if (m->m_len != 0) {
- if ((PCN_TX_LIST_CNT -
- (sc->pcn_cdata.pcn_tx_cnt + cnt)) < 2)
- return(ENOBUFS);
- f = &sc->pcn_ldata->pcn_tx_list[frag];
- f->pcn_txctl = (~(m->m_len) + 1) & PCN_TXCTL_BUFSZ;
- f->pcn_txctl |= PCN_TXCTL_MBO;
- f->pcn_tbaddr = vtophys(mtod(m, vm_offset_t));
- if (cnt == 0)
- f->pcn_txctl |= PCN_TXCTL_STP;
- else
- f->pcn_txctl |= PCN_TXCTL_OWN;
- cur = frag;
- PCN_INC(frag, PCN_TX_LIST_CNT);
- cnt++;
- }
+ if (m->m_len == 0)
+ continue;
+
+ if ((PCN_TX_LIST_CNT - (sc->pcn_cdata.pcn_tx_cnt + cnt)) < 2)
+ return(ENOBUFS);
+ f = &sc->pcn_ldata->pcn_tx_list[frag];
+ f->pcn_txctl = (~(m->m_len) + 1) & PCN_TXCTL_BUFSZ;
+ f->pcn_txctl |= PCN_TXCTL_MBO;
+ f->pcn_tbaddr = vtophys(mtod(m, vm_offset_t));
+ if (cnt == 0)
+ f->pcn_txctl |= PCN_TXCTL_STP;
+ else
+ f->pcn_txctl |= PCN_TXCTL_OWN;
+ cur = frag;
+ PCN_INC(frag, PCN_TX_LIST_CNT);
+ cnt++;
}
if (m != NULL)
OpenPOWER on IntegriCloud