]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Teach ofw_bus_parse_xref_list_alloc to be able to return the length of the parsed...
authorAdrian Chadd <adrian@FreeBSD.org>
Tue, 9 Feb 2016 03:35:40 +0000 (03:35 +0000)
committerAdrian Chadd <adrian@FreeBSD.org>
Tue, 9 Feb 2016 03:35:40 +0000 (03:35 +0000)
commit91ef8da010fb8edf25b66d89994c0889ca15fb47
treed1e44bc0be615e93d4037f32aebdfb5e0b6b5175
parent78a38b8f05f9dbb70ca12e0223ef52984f3aa65f
Teach ofw_bus_parse_xref_list_alloc to be able to return the length of the parsed list.

Currently, there is no easy way to know in advance how many entries a list parsed by
ofw_bus_parse_xref_list_alloc() in sys/dev/ofw/ofw_bus_subr.c has.

This patch:

* teaches the existing function about handling idx == -1 and returning how big
  the set is; then renames it as _internal;
* create a new function that asserts idx != -1, so the old API is maintained;
* add a new function that returns just the list length.

Submitted by: Stanislav Galabov <sgalabov@gmail.com>
Differential Revision: https://reviews.freebsd.org/D5043
sys/dev/ofw/ofw_bus_subr.c
sys/dev/ofw/ofw_bus_subr.h