diff mbox series

dm vdo memory-alloc: simplify allocations_allowed()

Message ID 283c9cd21b553d5da30770c382230ceb9e2d27c5.1709265835.git.msakai@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Mike Snitzer
Headers show
Series dm vdo memory-alloc: simplify allocations_allowed() | expand

Commit Message

Matthew Sakai March 1, 2024, 4:05 a.m. UTC
From: Mike Snitzer <snitzer@kernel.org>

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Susan LeGendre-McGhee <slegendr@redhat.com>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
---
 drivers/md/dm-vdo/memory-alloc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/md/dm-vdo/memory-alloc.c b/drivers/md/dm-vdo/memory-alloc.c
index 5cd387f9294e..db085c1124be 100644
--- a/drivers/md/dm-vdo/memory-alloc.c
+++ b/drivers/md/dm-vdo/memory-alloc.c
@@ -20,11 +20,9 @@ 
  */
 static struct thread_registry allocating_threads;
 
-static bool allocations_allowed(void)
+static inline bool allocations_allowed(void)
 {
-	const bool *pointer = vdo_lookup_thread(&allocating_threads);
-
-	return (pointer != NULL) ? *pointer : false;
+	return vdo_lookup_thread(&allocating_threads) != NULL;
 }
 
 /*