From 02a4d4e044f7545011ede4215b77b6c911275c48 Mon Sep 17 00:00:00 2001 From: imp Date: Tue, 12 Apr 2005 04:22:17 +0000 Subject: Return the resource created/found in resource_list_add to avoid an extra resouce_list_find in some places. Suggested by: sam Found by: Coventry Analysis tool. --- sys/kern/subr_bus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/kern') diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 438209f..c08d66b 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -2562,7 +2562,7 @@ resource_list_add_next(struct resource_list *rl, int type, u_long start, * If an existing entry exists with the same type and rid, it will be * modified using the given values of @p start, @p end and @p * count. If no entry exists, a new one will be created using the - * given values. + * given values. The resource list entry that matches is then returned. * * @param rl the resource list to edit * @param type the resource entry type (e.g. SYS_RES_MEMORY) @@ -2571,7 +2571,7 @@ resource_list_add_next(struct resource_list *rl, int type, u_long start, * @param end the end address of the resource * @param count XXX end-start+1 */ -void +struct resource_list_entry * resource_list_add(struct resource_list *rl, int type, int rid, u_long start, u_long end, u_long count) { @@ -2595,6 +2595,7 @@ resource_list_add(struct resource_list *rl, int type, int rid, rle->start = start; rle->end = end; rle->count = count; + return (rle); } /** -- cgit v1.1