Date: Tue, 09 Jun 2009 17:42:49 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: arch@freebsd.org Subject: devclass_find_free_unit Message-ID: <20090609.174249.-1435625969.imp@bsdimp.com>
next in thread | raw e-mail | index | archive | help
What purpose does devclass_find_free_unit serve? I think it can safely be eliminated from the tree. The current design is racy. Comments? It is currently used: ./arm/xscale/ixp425/.svn/text-base/avila_ata.c.svn-base: device_add_child(dev, "ata", devclass_find_free_unit(ata_devclass, 0)); ./arm/xscale/ixp425/avila_ata.c: device_add_child(dev, "ata", devclass_find_free_unit(ata_devclass, 0)); ./arm/at91/.svn/text-base/at91_cfata.c.svn-base: device_add_child(dev, "ata", devclass_find_free_unit(ata_devclass, 0)); ./arm/at91/at91_cfata.c: device_add_child(dev, "ata", devclass_find_free_unit(ata_devclass, 0)); ./powerpc/psim/.svn/text-base/ata_iobus.c.svn-base: devclass_find_free_unit(ata_devclass, 0)); # All the above can be replaced with a simple '-1'. ata/ata-pci.c: unit : devclass_find_free_unit(ata_devclass, 2)); ata/ata-usb.c: devclass_find_free_unit(ata_devclass, 2))) == NULL) { These can likely be replaced by '2', but that may result in a warning message being printed that likely can be eliminated... comments? Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090609.174249.-1435625969.imp>