From 540d62d3b252657267468df4030e4bc5e86d76d7 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 5 Sep 2021 21:40:01 +0200 Subject: [PATCH] Kernel: Simplify WatchDescription::create() --- Kernel/FileSystem/InodeWatcher.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Kernel/FileSystem/InodeWatcher.h b/Kernel/FileSystem/InodeWatcher.h index 96fcece63f..01260b2508 100644 --- a/Kernel/FileSystem/InodeWatcher.h +++ b/Kernel/FileSystem/InodeWatcher.h @@ -26,10 +26,7 @@ struct WatchDescription { static KResultOr> create(int wd, Inode& inode, unsigned event_mask) { - auto description = adopt_own_if_nonnull(new (nothrow) WatchDescription(wd, inode, event_mask)); - if (description) - return description.release_nonnull(); - return ENOMEM; + return adopt_nonnull_own_or_enomem(new (nothrow) WatchDescription(wd, inode, event_mask)); } private: