From a116b5d3e42e6379b48c0d6d074ab18c1216fa37 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Tue, 16 Jun 2020 22:53:56 +0000 Subject: [PATCH] vm: Drop vm_map_clip_{start,end} macro wrappers No functional change. Reviewed by: dougm, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D25282 --- sys/vm/vm_map.c | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 63463ba34038..5e3f6ed8afc0 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -2377,24 +2377,17 @@ vm_map_entry_clone(vm_map_t map, vm_map_entry_t entry) * the specified address; if necessary, * it splits the entry into two. */ -#define vm_map_clip_start(map, entry, startaddr) \ -{ \ - if (startaddr > entry->start) \ - _vm_map_clip_start(map, entry, startaddr); \ -} - -/* - * This routine is called only when it is known that - * the entry must be split. - */ static inline void -_vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start) +vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start) { vm_map_entry_t new_entry; + if (start <= entry->start) + return; + VM_MAP_ASSERT_LOCKED(map); KASSERT(entry->end > start && entry->start < start, - ("_vm_map_clip_start: invalid clip of entry %p", entry)); + ("%s: invalid clip of entry %p", __func__, entry)); new_entry = vm_map_entry_clone(map, entry); @@ -2435,24 +2428,17 @@ vm_map_lookup_clip_start(vm_map_t map, vm_offset_t start, * the specified address; if necessary, * it splits the entry into two. */ -#define vm_map_clip_end(map, entry, endaddr) \ -{ \ - if ((endaddr) < (entry->end)) \ - _vm_map_clip_end((map), (entry), (endaddr)); \ -} - -/* - * This routine is called only when it is known that - * the entry must be split. - */ static inline void -_vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end) +vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end) { vm_map_entry_t new_entry; + if (end >= entry->end) + return; + VM_MAP_ASSERT_LOCKED(map); KASSERT(entry->start < end && entry->end > end, - ("_vm_map_clip_end: invalid clip of entry %p", entry)); + ("%s: invalid clip of entry %p", __func__, entry)); new_entry = vm_map_entry_clone(map, entry);