newbus: type (max value) for device order

John Baldwin jhb at freebsd.org
Fri Sep 3 15:37:37 UTC 2010


On Friday, September 03, 2010 3:43:36 am Andriy Gapon wrote:
> 
> device_add_child_ordered() takes order as a parameter of int type.
> struct device stores it as u_char.
> 
> This can be confusing, can't it?
> In fact, up to r203776 we used to use order value of 100000 in acpi.c (which
> effectively was 160 according to my calculations).
> 
> Not sure what I want to suggest, perhaps defining DEVICE_MAX_ORDER or something.
> Or changing the type in struct device to int.

Just fix device_t to store an int I think.  Also, it should probably be a
u_int as negative values don't really make sense.

-- 
John Baldwin

-- 
John Baldwin


More information about the freebsd-arch mailing list