Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Use LIST_FOREACH when possible.



details:   https://anonhg.NetBSD.org/src/rev/040e9326837d
branches:  trunk
changeset: 760370:040e9326837d
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Jan 04 01:29:01 2011 +0000

description:
Use LIST_FOREACH when possible.

diffstat:

 sys/dev/usb/usb_mem.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r bc5671de7b55 -r 040e9326837d sys/dev/usb/usb_mem.c
--- a/sys/dev/usb/usb_mem.c     Tue Jan 04 01:28:15 2011 +0000
+++ b/sys/dev/usb/usb_mem.c     Tue Jan 04 01:29:01 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_mem.c,v 1.43 2010/12/16 10:08:43 pooka Exp $       */
+/*     $NetBSD: usb_mem.c,v 1.44 2011/01/04 01:29:01 matt Exp $        */
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.43 2010/12/16 10:08:43 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.44 2011/01/04 01:29:01 matt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -121,7 +121,7 @@
 
        s = splusb();
        /* First check the free list. */
-       for (p = LIST_FIRST(&usb_blk_freelist); p; p = LIST_NEXT(p, next)) {
+       LIST_FOREACH(p, &usb_blk_freelist, next) {
                if (p->tag == tag && p->size >= size && p->align >= align) {
                        LIST_REMOVE(p, next);
                        usb_blk_nfree--;
@@ -246,7 +246,7 @@
 
        s = splusb();
        /* Check for free fragments. */
-       for (f = LIST_FIRST(&usb_frag_freelist); f; f = LIST_NEXT(f, next)) {
+       LIST_FOREACH(f, &usb_frag_freelist, next) {
                if (f->block->tag == tag)
                        break;
        }



Home | Main Index | Thread Index | Old Index