Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Sep 2010 02:05:08 +0000 (UTC)
From:      Weongyo Jeong <weongyo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r212596 - user/weongyo/usb/sys/dev/usb/controller
Message-ID:  <201009140205.o8E258aZ055571@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: weongyo
Date: Tue Sep 14 02:05:08 2010
New Revision: 212596
URL: http://svn.freebsd.org/changeset/base/212596

Log:
  Initializes `bus->generation' when the USB bus structure is initialized
  that don't need to check it whenever usb_bus_explore() is called because
  it'd not be decreased.

Modified:
  user/weongyo/usb/sys/dev/usb/controller/usb_controller.c

Modified: user/weongyo/usb/sys/dev/usb/controller/usb_controller.c
==============================================================================
--- user/weongyo/usb/sys/dev/usb/controller/usb_controller.c	Tue Sep 14 01:52:16 2010	(r212595)
+++ user/weongyo/usb/sys/dev/usb/controller/usb_controller.c	Tue Sep 14 02:05:08 2010	(r212596)
@@ -198,10 +198,6 @@ usb_bus_explore(void *arg, int npending)
 			bus->do_probe = 0;
 			bus->generation++;
 		}
-		if (bus->generation == 0) {
-			/* avoid zero, hence that is memory default */
-			bus->generation = 1;
-		}
 
 #ifdef DDB
 		/*
@@ -541,6 +537,7 @@ usb_bus_struct_init(struct usb_bus *bus,
 	bus->devices_max = udevsmax;
 	bus->busmem_func = busmem_func;
 	bus->alloc_failed = 0;
+	bus->generation = 1;
 
 	mtx_init(&bus->bus_mtx, device_get_nameunit(bus->parent),
 	    NULL, MTX_DEF);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009140205.o8E258aZ055571>