From 4d0827c51796ed790ac9b928d4ac6af0cac9e050 Mon Sep 17 00:00:00 2001 From: mdodd Date: Wed, 13 Apr 2005 01:32:06 +0000 Subject: Invert conditional and use continue to reduce nesting. --- sys/pci/if_pcn.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'sys/pci') 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) -- cgit v1.1