Tidy up code a bit. Add missing section comments.

No functional change.

MFC after:	1 week
Sponsored by:	Mellanox Technologies // NVIDIA Networking
This commit is contained in:
Hans Petter Selasky 2020-12-07 10:21:01 +00:00
parent a399cf139b
commit 34602358c0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=368407

View File

@ -30,23 +30,14 @@ struct usb_process usb_process[USB_PROC_MAX];
static device_t usb_pci_root;
/*------------------------------------------------------------------------*
* Implementation of mutex API
*------------------------------------------------------------------------*/
struct mtx Giant;
int (*bus_alloc_resource_any_cb)(struct resource *res, device_t dev,
int type, int *rid, unsigned int flags);
int (*ofw_bus_status_ok_cb)(device_t dev);
int (*ofw_bus_is_compatible_cb)(device_t dev, char *name);
static void
mtx_system_init(void *arg)
{
mtx_init(&Giant, "Giant", NULL, MTX_DEF | MTX_RECURSE);
}
SYSINIT(mtx_system_init, SI_SUB_LOCK, SI_ORDER_MIDDLE, mtx_system_init, NULL);
/*------------------------------------------------------------------------*
* Implementation of busdma API
*------------------------------------------------------------------------*/
int
bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
bus_size_t boundary, bus_addr_t lowaddr,
@ -115,6 +106,10 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat)
return (0);
}
/*------------------------------------------------------------------------*
* Implementation of resource management API
*------------------------------------------------------------------------*/
struct resource *
bus_alloc_resource_any(device_t dev, int type, int *rid, unsigned int flags)
{
@ -255,6 +250,19 @@ ofw_bus_is_compatible(device_t dev, char *name)
return ((*ofw_bus_is_compatible_cb)(dev, name));
}
/*------------------------------------------------------------------------*
* Implementation of mutex API
*------------------------------------------------------------------------*/
struct mtx Giant;
static void
mtx_system_init(void *arg)
{
mtx_init(&Giant, "Giant", NULL, MTX_DEF | MTX_RECURSE);
}
SYSINIT(mtx_system_init, SI_SUB_LOCK, SI_ORDER_MIDDLE, mtx_system_init, NULL);
void
mtx_init(struct mtx *mtx, const char *name, const char *type, int opt)
{