Use while(cond){} instead of for(;;){if(!cond)break;}.
This commit is contained in:
parent
df91c0f20b
commit
a856761fb4
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_mec.c,v 1.23 2008/08/10 16:18:43 tsutsui Exp $ */
|
/* $NetBSD: if_mec.c,v 1.24 2008/08/10 16:21:28 tsutsui Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2004 Izumi Tsutsui. All rights reserved.
|
* Copyright (c) 2004 Izumi Tsutsui. All rights reserved.
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.23 2008/08/10 16:18:43 tsutsui Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_mec.c,v 1.24 2008/08/10 16:21:28 tsutsui Exp $");
|
||||||
|
|
||||||
#include "opt_ddb.h"
|
#include "opt_ddb.h"
|
||||||
#include "bpfilter.h"
|
#include "bpfilter.h"
|
||||||
|
@ -830,18 +830,13 @@ mec_start(struct ifnet *ifp)
|
||||||
DPRINTF(MEC_DEBUG_START,
|
DPRINTF(MEC_DEBUG_START,
|
||||||
("mec_start: opending = %d, firsttx = %d\n", opending, firsttx));
|
("mec_start: opending = %d, firsttx = %d\n", opending, firsttx));
|
||||||
|
|
||||||
for (;;) {
|
while (sc->sc_txpending < MEC_NTXDESC - 1) {
|
||||||
/* Grab a packet off the queue. */
|
/* Grab a packet off the queue. */
|
||||||
IFQ_POLL(&ifp->if_snd, m0);
|
IFQ_POLL(&ifp->if_snd, m0);
|
||||||
if (m0 == NULL)
|
if (m0 == NULL)
|
||||||
break;
|
break;
|
||||||
m = NULL;
|
m = NULL;
|
||||||
|
|
||||||
if (sc->sc_txpending == MEC_NTXDESC - 1) {
|
|
||||||
/* preserve the last entry to avoid wraparound */
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the next available transmit descriptor.
|
* Get the next available transmit descriptor.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue