diff options
author | imp <imp@FreeBSD.org> | 2005-04-12 04:22:17 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-04-12 04:22:17 +0000 |
commit | 02a4d4e044f7545011ede4215b77b6c911275c48 (patch) | |
tree | 51e3519b7059a92f85cdd70846d46aada036d31b /sys/kern/subr_bus.c | |
parent | 3093d067e44a453f3928c9dde355c6257dc96e3f (diff) | |
download | FreeBSD-src-02a4d4e044f7545011ede4215b77b6c911275c48.zip FreeBSD-src-02a4d4e044f7545011ede4215b77b6c911275c48.tar.gz |
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.
Diffstat (limited to 'sys/kern/subr_bus.c')
-rw-r--r-- | sys/kern/subr_bus.c | 5 |
1 files changed, 3 insertions, 2 deletions
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); } /** |