mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
Invert conditional and use continue to reduce nesting.
This commit is contained in:
parent
df214d19a3
commit
c7ae8b4fa8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144981
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user