Module Name:    src
Committed By:   matt
Date:           Tue Jan  4 01:29:01 UTC 2011

Modified Files:
        src/sys/dev/usb: usb_mem.c

Log Message:
Use LIST_FOREACH when possible.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/usb/usb_mem.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usb_mem.c
diff -u src/sys/dev/usb/usb_mem.c:1.43 src/sys/dev/usb/usb_mem.c:1.44
--- src/sys/dev/usb/usb_mem.c:1.43	Thu Dec 16 10:08:43 2010
+++ src/sys/dev/usb/usb_mem.c	Tue Jan  4 01:29:01 2011
@@ -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;
 	}

Reply via email to