diff options
author | phk <phk@FreeBSD.org> | 2001-02-04 13:13:25 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2001-02-04 13:13:25 +0000 |
commit | e87f7a15ad62e1dd25061ddb301662e809692c2c (patch) | |
tree | 5f0ba9ebd57fbfd6e13f2b9403d96e9bfae48d8f /sys/dev | |
parent | f3b4fbe35f6e8e9d09f742c114281d8e9984d135 (diff) | |
download | FreeBSD-src-e87f7a15ad62e1dd25061ddb301662e809692c2c.zip FreeBSD-src-e87f7a15ad62e1dd25061ddb301662e809692c2c.tar.gz |
Mechanical change to use <sys/queue.h> macro API instead of
fondling implementation details.
Created with: sed(1)
Reviewed by: md5(1)
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/aic7xxx/aicasm/aicasm.c | 14 | ||||
-rw-r--r-- | sys/dev/aic7xxx/aicasm/aicasm_symbol.c | 40 | ||||
-rw-r--r-- | sys/dev/asr/asr.c | 2 | ||||
-rw-r--r-- | sys/dev/de/if_de.c | 12 | ||||
-rw-r--r-- | sys/dev/ed/if_ed.c | 4 | ||||
-rw-r--r-- | sys/dev/eisa/eisaconf.c | 6 | ||||
-rw-r--r-- | sys/dev/ex/if_ex.c | 2 | ||||
-rw-r--r-- | sys/dev/fe/if_fe.c | 4 | ||||
-rw-r--r-- | sys/dev/ie/if_ie.c | 4 | ||||
-rw-r--r-- | sys/dev/pdq/pdq_ifsubr.c | 4 | ||||
-rw-r--r-- | sys/dev/sf/if_sf.c | 2 | ||||
-rw-r--r-- | sys/dev/sk/if_sk.c | 2 | ||||
-rw-r--r-- | sys/dev/sn/if_sn.c | 4 | ||||
-rw-r--r-- | sys/dev/ti/if_ti.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/uhci.c | 2 | ||||
-rw-r--r-- | sys/dev/wl/if_wl.c | 6 | ||||
-rw-r--r-- | sys/dev/xe/if_xe.c | 8 |
17 files changed, 60 insertions, 60 deletions
diff --git a/sys/dev/aic7xxx/aicasm/aicasm.c b/sys/dev/aic7xxx/aicasm/aicasm.c index 8ca1f65..1402b3a 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm.c +++ b/sys/dev/aic7xxx/aicasm/aicasm.c @@ -178,9 +178,9 @@ main(int argc, char *argv[]) "times\n", appname); } includes_search_curdir = 0; - for (include_dir = search_path.slh_first; + for (include_dir = SLIST_FIRST(&search_path); include_dir != NULL; - include_dir = include_dir->links.sle_next) + include_dir = SLIST_NEXT(include_dir, links)) /* * All entries before a '-I-' only * apply to includes specified with @@ -276,9 +276,9 @@ back_patch() { struct instruction *cur_instr; - for(cur_instr = seq_program.stqh_first; + for(cur_instr = STAILQ_FIRST(&seq_program); cur_instr != NULL; - cur_instr = cur_instr->links.stqe_next) { + cur_instr = STAILQ_NEXT(cur_instr, links)) { if (cur_instr->patch_label != NULL) { struct ins_format3 *f3_instr; u_int address; @@ -316,12 +316,12 @@ output_code() */\n"); fprintf(ofile, "static uint8_t seqprog[] = {\n"); - for(cur_instr = seq_program.stqh_first; + for(cur_instr = STAILQ_FIRST(&seq_program); cur_instr != NULL; - cur_instr = cur_instr->links.stqe_next) { + cur_instr = STAILQ_NEXT(cur_instr, links)) { fprintf(ofile, "%s\t0x%02x, 0x%02x, 0x%02x, 0x%02x", - cur_instr == seq_program.stqh_first ? "" : ",\n", + cur_instr == STAILQ_FIRST(&seq_program) ? "" : ",\n", #if BYTE_ORDER == LITTLE_ENDIAN cur_instr->format.bytes[0], cur_instr->format.bytes[1], diff --git a/sys/dev/aic7xxx/aicasm/aicasm_symbol.c b/sys/dev/aic7xxx/aicasm/aicasm_symbol.c index 1e51d62..974c8c4 100644 --- a/sys/dev/aic7xxx/aicasm/aicasm_symbol.c +++ b/sys/dev/aic7xxx/aicasm/aicasm_symbol.c @@ -191,11 +191,11 @@ symlist_search(symlist_t *symlist, char *symname) { symbol_node_t *curnode; - curnode = symlist->slh_first; + curnode = SLIST_FIRST(symlist); while(curnode != NULL) { if (strcmp(symname, curnode->symbol->name) == 0) break; - curnode = curnode->links.sle_next; + curnode = SLIST_NEXT(curnode, links); } return (curnode); } @@ -231,7 +231,7 @@ symlist_add(symlist_t *symlist, symbol_t *symbol, int how) /* NOTREACHED */ } - curnode = symlist->slh_first; + curnode = SLIST_FIRST(symlist); if (curnode == NULL || (mask && (curnode->symbol->info.minfo->mask > newnode->symbol->info.minfo->mask)) @@ -242,14 +242,14 @@ symlist_add(symlist_t *symlist, symbol_t *symbol, int how) } while (1) { - if (curnode->links.sle_next == NULL) { + if (SLIST_NEXT(curnode, links) == NULL) { SLIST_INSERT_AFTER(curnode, newnode, links); break; } else { symbol_t *cursymbol; - cursymbol = curnode->links.sle_next->symbol; + cursymbol = SLIST_NEXT(curnode, links)->symbol; if ((mask && (cursymbol->info.minfo->mask > symbol->info.minfo->mask)) || (!mask &&(cursymbol->info.rinfo->address > @@ -259,7 +259,7 @@ symlist_add(symlist_t *symlist, symbol_t *symbol, int how) break; } } - curnode = curnode->links.sle_next; + curnode = SLIST_NEXT(curnode, links); } } else { SLIST_INSERT_HEAD(symlist, newnode, links); @@ -271,9 +271,9 @@ symlist_free(symlist_t *symlist) { symbol_node_t *node1, *node2; - node1 = symlist->slh_first; + node1 = SLIST_FIRST(symlist); while (node1 != NULL) { - node2 = node1->links.sle_next; + node2 = SLIST_NEXT(node1, links); free(node1); node1 = node2; } @@ -287,7 +287,7 @@ symlist_merge(symlist_t *symlist_dest, symlist_t *symlist_src1, symbol_node_t *node; *symlist_dest = *symlist_src1; - while((node = symlist_src2->slh_first) != NULL) { + while((node = SLIST_FIRST(symlist_src2)) != NULL) { SLIST_REMOVE_HEAD(symlist_src2, links); SLIST_INSERT_HEAD(symlist_dest, node, links); } @@ -357,28 +357,28 @@ symtable_dump(FILE *ofile) } /* Put in the masks and bits */ - while (masks.slh_first != NULL) { + while (SLIST_FIRST(&masks) != NULL) { symbol_node_t *curnode; symbol_node_t *regnode; char *regname; - curnode = masks.slh_first; + curnode = SLIST_FIRST(&masks); SLIST_REMOVE_HEAD(&masks, links); regnode = - curnode->symbol->info.minfo->symrefs.slh_first; + SLIST_FIRST(&curnode->symbol->info.minfo->symrefs); regname = regnode->symbol->name; regnode = symlist_search(®isters, regname); SLIST_INSERT_AFTER(regnode, curnode, links); } /* Add the aliases */ - while (aliases.slh_first != NULL) { + while (SLIST_FIRST(&aliases) != NULL) { symbol_node_t *curnode; symbol_node_t *regnode; char *regname; - curnode = aliases.slh_first; + curnode = SLIST_FIRST(&aliases); SLIST_REMOVE_HEAD(&aliases, links); regname = curnode->symbol->info.ainfo->parent->name; @@ -391,13 +391,13 @@ symtable_dump(FILE *ofile) "/* * DO NOT EDIT - This file is automatically generated. */\n"); - while (registers.slh_first != NULL) { + while (SLIST_FIRST(®isters) != NULL) { symbol_node_t *curnode; u_int8_t value; char *tab_str; char *tab_str2; - curnode = registers.slh_first; + curnode = SLIST_FIRST(®isters); SLIST_REMOVE_HEAD(®isters, links); switch(curnode->symbol->type) { case REGISTER: @@ -439,10 +439,10 @@ symtable_dump(FILE *ofile) } fprintf(ofile, "\n\n"); - while (constants.slh_first != NULL) { + while (SLIST_FIRST(&constants) != NULL) { symbol_node_t *curnode; - curnode = constants.slh_first; + curnode = SLIST_FIRST(&constants); SLIST_REMOVE_HEAD(&constants, links); fprintf(ofile, "#define\t%-8s\t0x%02x\n", curnode->symbol->name, @@ -453,10 +453,10 @@ symtable_dump(FILE *ofile) fprintf(ofile, "\n\n/* Downloaded Constant Definitions */\n"); - while (download_constants.slh_first != NULL) { + while (SLIST_FIRST(&download_constants) != NULL) { symbol_node_t *curnode; - curnode = download_constants.slh_first; + curnode = SLIST_FIRST(&download_constants); SLIST_REMOVE_HEAD(&download_constants, links); fprintf(ofile, "#define\t%-8s\t0x%02x\n", curnode->symbol->name, diff --git a/sys/dev/asr/asr.c b/sys/dev/asr/asr.c index 058c304..9f1b859 100644 --- a/sys/dev/asr/asr.c +++ b/sys/dev/asr/asr.c @@ -2249,7 +2249,7 @@ ASR_sync ( * issuing a shutdown or an adapter reset). */ if ((sc != (Asr_softc_t *)NULL) - && (sc->ha_ccb.lh_first != (struct ccb_hdr *)NULL) + && (LIST_FIRST(&sc->ha_ccb) != (struct ccb_hdr *)NULL) && ((TID = ASR_getTid (sc, bus, target, lun)) != (tid_t)-1) && (TID != (tid_t)0)) { defAlignLong(PRIVATE_SCSI_SCB_EXECUTE_MESSAGE,Message); diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index 108518e..b756bae 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -3012,8 +3012,8 @@ tulip_addr_filter( #endif multicnt = 0; - for (ifma = sc->tulip_if.if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + for (ifma = LIST_FIRST(&sc->tulip_if.if_multiaddrs); ifma != NULL; + ifma = LIST_NEXT(ifma, ifma_link)) { if (ifma->ifma_addr->sa_family == AF_LINK) multicnt++; @@ -3041,8 +3041,8 @@ tulip_addr_filter( */ bzero(sc->tulip_setupdata, sizeof(sc->tulip_setupdata)); - for (ifma = sc->tulip_if.if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + for (ifma = LIST_FIRST(&sc->tulip_if.if_multiaddrs); ifma != NULL; + ifma = LIST_NEXT(ifma, ifma_link)) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; @@ -3092,8 +3092,8 @@ tulip_addr_filter( /* * Else can get perfect filtering for 16 addresses. */ - for (ifma = sc->tulip_if.if_multiaddrs.lh_first; ifma != NULL; - ifma = ifma->ifma_link.le_next) { + for (ifma = LIST_FIRST(&sc->tulip_if.if_multiaddrs); ifma != NULL; + ifma = LIST_NEXT(ifma, ifma_link)) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; addrp = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 08e7cc1..700f193 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -3286,8 +3286,8 @@ ds_getmcaf(sc, mcaf) mcaf[0] = 0; mcaf[1] = 0; - for (ifma = sc->arpcom.ac_if.if_multiaddrs.lh_first; ifma; - ifma = ifma->ifma_link.le_next) { + for (ifma = LIST_FIRST(&sc->arpcom.ac_if.if_multiaddrs); ifma; + ifma = LIST_NEXT(ifma, ifma_link)) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; index = ds_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)) diff --git a/sys/dev/eisa/eisaconf.c b/sys/dev/eisa/eisaconf.c index a781251..d67b453 100644 --- a/sys/dev/eisa/eisaconf.c +++ b/sys/dev/eisa/eisaconf.c @@ -539,12 +539,12 @@ eisa_add_resvaddr(struct eisa_device *e_dev, struct resvlist *head, u_long base, reservation->size = size; reservation->flags = flags; - if (!head->lh_first) { + if (!LIST_FIRST(head)) { LIST_INSERT_HEAD(head, reservation, links); } else { resvaddr_t *node; - for(node = head->lh_first; node; node = node->links.le_next) { + LIST_FOREACH(node, head, links) { if (node->addr > reservation->addr) { /* * List is sorted in increasing @@ -564,7 +564,7 @@ eisa_add_resvaddr(struct eisa_device *e_dev, struct resvlist *head, u_long base, return (EEXIST); } - if (!node->links.le_next) { + if (!LIST_NEXT(node, links)) { LIST_INSERT_AFTER(node, reservation, links); break; } diff --git a/sys/dev/ex/if_ex.c b/sys/dev/ex/if_ex.c index 3ff0f5b..2a3dcfd 100644 --- a/sys/dev/ex/if_ex.c +++ b/sys/dev/ex/if_ex.c @@ -282,7 +282,7 @@ ex_init(void *xsc) DODEBUG(Start_End, printf("ex_init%d: start\n", ifp->if_unit);); - if (ifp->if_addrhead.tqh_first == NULL) { + if (TAILQ_FIRST(&ifp->if_addrhead) == NULL) { return; } s = splimp(); diff --git a/sys/dev/fe/if_fe.c b/sys/dev/fe/if_fe.c index 3e789b4..e5a49d0 100644 --- a/sys/dev/fe/if_fe.c +++ b/sys/dev/fe/if_fe.c @@ -2120,8 +2120,8 @@ fe_mcaf ( struct fe_softc *sc ) struct ifmultiaddr *ifma; filter = fe_filter_nothing; - for (ifma = sc->arpcom.ac_if.if_multiaddrs.lh_first; ifma; - ifma = ifma->ifma_link.le_next) { + for (ifma = LIST_FIRST(&sc->arpcom.ac_if.if_multiaddrs); ifma; + ifma = LIST_NEXT(ifma, ifma_link)) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; index = fe_hash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); diff --git a/sys/dev/ie/if_ie.c b/sys/dev/ie/if_ie.c index ebebabb..3f7033d 100644 --- a/sys/dev/ie/if_ie.c +++ b/sys/dev/ie/if_ie.c @@ -2150,8 +2150,8 @@ ie_mc_reset(int unit) * Step through the list of addresses. */ ie->mcast_count = 0; - for (ifma = ie->arpcom.ac_if.if_multiaddrs.lh_first; ifma; - ifma = ifma->ifma_link.le_next) { + for (ifma = LIST_FIRST(&ie->arpcom.ac_if.if_multiaddrs); ifma; + ifma = LIST_NEXT(ifma, ifma_link)) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; diff --git a/sys/dev/pdq/pdq_ifsubr.c b/sys/dev/pdq/pdq_ifsubr.c index ac9d3d2..3c437a8 100644 --- a/sys/dev/pdq/pdq_ifsubr.c +++ b/sys/dev/pdq/pdq_ifsubr.c @@ -227,8 +227,8 @@ pdq_os_addr_fill( pdq_softc_t *sc = (pdq_softc_t *) pdq->pdq_os_ctx; struct ifmultiaddr *ifma; - for (ifma = sc->sc_if.if_multiaddrs.lh_first; ifma && num_addrs > 0; - ifma = ifma->ifma_link.le_next) { + for (ifma = LIST_FIRST(&sc->sc_if.if_multiaddrs); ifma && num_addrs > 0; + ifma = LIST_NEXT(ifma, ifma_link)) { char *mcaddr; if (ifma->ifma_addr->sa_family != AF_LINK) continue; diff --git a/sys/dev/sf/if_sf.c b/sys/dev/sf/if_sf.c index ff01bf0..29f3fe3 100644 --- a/sys/dev/sf/if_sf.c +++ b/sys/dev/sf/if_sf.c @@ -450,7 +450,7 @@ static void sf_setmulti(sc) i = 1; /* First find the tail of the list. */ LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_link.le_next == NULL) + if (LIST_NEXT(ifma, ifma_link) == NULL) break; } /* Now traverse the list backwards. */ diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c index a0dc45a..a6dba79 100644 --- a/sys/dev/sk/if_sk.c +++ b/sys/dev/sk/if_sk.c @@ -559,7 +559,7 @@ static void sk_setmulti(sc_if) i = 1; /* First find the tail of the list. */ LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_link.le_next == NULL) + if (LIST_NEXT(ifma, ifma_link) == NULL) break; } /* Now traverse the list backwards. */ diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c index 2b39024..e9a856d 100644 --- a/sys/dev/sn/if_sn.c +++ b/sys/dev/sn/if_sn.c @@ -1461,8 +1461,8 @@ sn_getmcf(struct arpcom *ac, u_char *mcf) bzero(mcf, MCFSZ); - for (ifma = ac->ac_if.if_multiaddrs.lh_first; ifma; - ifma = ifma->ifma_link.le_next) { + for (ifma = LIST_FIRST(&ac->ac_if.if_multiaddrs); ifma; + ifma = LIST_NEXT(ifma, ifma_link)) { if (ifma->ifma_addr->sa_family != AF_LINK) return 0; index = smc_crc(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)) & 0x3f; diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c index cb28d01..1d52547 100644 --- a/sys/dev/ti/if_ti.c +++ b/sys/dev/ti/if_ti.c @@ -1073,8 +1073,8 @@ static void ti_setmulti(sc) CSR_WRITE_4(sc, TI_MB_HOSTINTR, 1); /* First, zot all the existing filters. */ - while (sc->ti_mc_listhead.slh_first != NULL) { - mc = sc->ti_mc_listhead.slh_first; + while (SLIST_FIRST(&sc->ti_mc_listhead) != NULL) { + mc = SLIST_FIRST(&sc->ti_mc_listhead); ti_del_mcast(sc, &mc->mc_addr); SLIST_REMOVE_HEAD(&sc->ti_mc_listhead, mc_entries); free(mc, M_DEVBUF); diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c index 1628268..761a458 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -985,7 +985,7 @@ uhci_intr(void *arg) * We scan all interrupt descriptors to see if any have * completed. */ - for (ii = LIST_FIRST(&sc->sc_intrhead); ii; ii = LIST_NEXT(ii, list)) + LIST_FOREACH(ii, &sc->sc_intrhead, list) uhci_check_intr(sc, ii); DPRINTFN(10, ("%s: uhci_intr: exit\n", USBDEVNAME(sc->sc_bus.bdev))); diff --git a/sys/dev/wl/if_wl.c b/sys/dev/wl/if_wl.c index e1aec04..67a50d7 100644 --- a/sys/dev/wl/if_wl.c +++ b/sys/dev/wl/if_wl.c @@ -682,7 +682,7 @@ wlinit(void *xsc) printf("wl%d: entered wlinit()\n",sc->unit); #endif #if defined(__FreeBSD__) && __FreeBSD_version >= 300000 - if (ifp->if_addrhead.tqh_first == (struct ifaddr *)0) { + if (TAILQ_FIRST(&ifp->if_addrhead) == (struct ifaddr *)0) { #else if (ifp->if_addrlist == (struct ifaddr *)0) { #endif @@ -2060,8 +2060,8 @@ wlconfig(int unit) outw(PIOP1(base), AC_MCSETUP|AC_CW_EL); /* ac_command */ outw(PIOR1(base), OFFSET_CU + 8); #if defined(__FreeBSD__) && __FreeBSD_version >= 300000 - for (ifma = sc->wl_if.if_multiaddrs.lh_first; ifma; - ifma = ifma->ifma_link.le_next) { + for (ifma = LIST_FIRST(&sc->wl_if.if_multiaddrs); ifma; + ifma = LIST_NEXT(ifma, ifma_link)) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; diff --git a/sys/dev/xe/if_xe.c b/sys/dev/xe/if_xe.c index 78742ba..d0e1dd2 100644 --- a/sys/dev/xe/if_xe.c +++ b/sys/dev/xe/if_xe.c @@ -1590,10 +1590,10 @@ xe_setmulti(struct xe_softc *scp) { int count; ifp = &scp->arpcom.ac_if; - maddr = ifp->if_multiaddrs.lh_first; + maddr = LIST_FIRST(&ifp->if_multiaddrs); /* Get length of multicast list */ - for (count = 0; maddr != NULL; maddr = maddr->ifma_link.le_next, count++); + for (count = 0; maddr != NULL; maddr = LIST_NEXT(maddr, ifma_link), count++); if ((ifp->if_flags & IFF_PROMISC) || (ifp->if_flags & IFF_ALLMULTI) || (count > 9)) { /* @@ -1643,7 +1643,7 @@ xe_setaddrs(struct xe_softc *scp) { u_int8_t *addr; u_int8_t page, slot, byte, i; - maddr = scp->arpcom.ac_if.if_multiaddrs.lh_first; + maddr = LIST_FIRST(&scp->arpcom.ac_if.if_multiaddrs); XE_SELECT_PAGE(page = 0x50); @@ -1653,7 +1653,7 @@ xe_setaddrs(struct xe_softc *scp) { addr = (u_int8_t *)(&scp->arpcom.ac_enaddr); else { while (maddr != NULL && maddr->ifma_addr->sa_family != AF_LINK) - maddr = maddr->ifma_link.le_next; + maddr = LIST_NEXT(maddr, ifma_link); if (maddr != NULL) addr = LLADDR((struct sockaddr_dl *)maddr->ifma_addr); else |