summaryrefslogtreecommitdiffstats
path: root/sys/cam/scsi
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2001-02-04 16:08:18 +0000
committerphk <phk@FreeBSD.org>2001-02-04 16:08:18 +0000
commit709379c1aeaadc2770d45e2cb1bc6428c65f09d3 (patch)
treedfeb80ff1352759a12e59878a24ad037eef63ea0 /sys/cam/scsi
parente01468552648a6fc51185ba9e47435b0d00ff96f (diff)
downloadFreeBSD-src-709379c1aeaadc2770d45e2cb1bc6428c65f09d3.zip
FreeBSD-src-709379c1aeaadc2770d45e2cb1bc6428c65f09d3.tar.gz
Another round of the <sys/queue.h> FOREACH transmogriffer.
Created with: sed(1) Reviewed by: md5(1)
Diffstat (limited to 'sys/cam/scsi')
-rw-r--r--sys/cam/scsi/scsi_da.c3
-rw-r--r--sys/cam/scsi/scsi_low.c18
2 files changed, 7 insertions, 14 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 91c2661..70385c7 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -1568,8 +1568,7 @@ dashutdown(void * arg, int howto)
struct cam_periph *periph;
struct da_softc *softc;
- for (periph = TAILQ_FIRST(&dadriver.units); periph != NULL;
- periph = TAILQ_NEXT(periph, unit_links)) {
+ TAILQ_FOREACH(periph, &dadriver.units, unit_links) {
union ccb ccb;
softc = (struct da_softc *)periph->softc;
diff --git a/sys/cam/scsi/scsi_low.c b/sys/cam/scsi/scsi_low.c
index 25c9437..683c31d 100644
--- a/sys/cam/scsi/scsi_low.c
+++ b/sys/cam/scsi/scsi_low.c
@@ -341,11 +341,9 @@ scsi_low_timeout(arg)
{
struct targ_info *ti;
- for (ti = TAILQ_FIRST(&slp->sl_titab); ti != NULL;
- ti = TAILQ_NEXT(ti, ti_chain))
+ TAILQ_FOREACH(ti, &slp->sl_titab, ti_chain)
{
- for (cb = TAILQ_FIRST(&ti->ti_discq); cb != NULL;
- cb = TAILQ_NEXT(cb, ccb_chain))
+ TAILQ_FOREACH(cb, &ti->ti_discq, ccb_chain)
{
cb->ccb_tc -= SCSI_LOW_TIMEOUT_CHECK_INTERVAL;
if (cb->ccb_tc < 0)
@@ -930,8 +928,7 @@ scsi_low_start(slp)
}
#endif /* SCSI_LOW_DIAGNOSTIC */
- for (cb = TAILQ_FIRST(&slp->sl_start); cb != NULL;
- cb = TAILQ_NEXT(cb, ccb_chain))
+ TAILQ_FOREACH(cb, &slp->sl_start, ccb_chain)
{
ti = cb->ti;
li = cb->li;
@@ -1347,8 +1344,7 @@ scsi_low_reset_nexus(slp, fdone)
}
/* disconnected nexus */
- for (ti = TAILQ_FIRST(&slp->sl_titab); ti != NULL;
- ti = TAILQ_NEXT(ti, ti_chain))
+ TAILQ_FOREACH(ti, &slp->sl_titab, ti_chain)
{
for (cb = TAILQ_FIRST(&ti->ti_discq); cb != NULL; cb = ncb)
{
@@ -1363,8 +1359,7 @@ scsi_low_reset_nexus(slp, fdone)
}
}
- for (li = LIST_FIRST(&ti->ti_litab); li != NULL;
- li = LIST_NEXT(li, lun_chain))
+ LIST_FOREACH(li, &ti->ti_litab, lun_chain)
{
li->li_state = UNIT_SLEEP;
li->li_disc = 0;
@@ -2496,8 +2491,7 @@ scsi_low_info(slp, ti, s)
printf("%s: SCSI_LOW: %s\n", slp->sl_xname, s);
if (ti == NULL)
{
- for (ti = TAILQ_FIRST(&slp->sl_titab); ti != NULL;
- ti = TAILQ_NEXT(ti, ti_chain))
+ TAILQ_FOREACH(ti, &slp->sl_titab, ti_chain)
scsi_low_print(slp, ti);
}
else
OpenPOWER on IntegriCloud