diff mbox series

[8/8] dm vdo memory-alloc: mark branch unlikely() in uds_allocate_memory()

Message ID 1627ae51fd2896d5d24748456f1a2e10ad299e8f.1699675570.git.msakai@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Mike Snitzer
Headers show
Series dm vdo memory-alloc: various fixes | expand

Commit Message

Matthew Sakai Nov. 11, 2023, 4:30 a.m. UTC
From: Mike Snitzer <snitzer@kernel.org>

Remove temporary 'duration' variable. And cleanup coding style nit.

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

Patch

diff --git a/drivers/md/dm-vdo/memory-alloc.c b/drivers/md/dm-vdo/memory-alloc.c
index 136a19db33be..e9464d4a1e64 100644
--- a/drivers/md/dm-vdo/memory-alloc.c
+++ b/drivers/md/dm-vdo/memory-alloc.c
@@ -286,13 +286,9 @@  int uds_allocate_memory(size_t size, size_t align, const char *what, void *ptr)
 	if (allocations_restricted)
 		memalloc_noio_restore(noio_flags);
 
-	if (p == NULL) {
-		unsigned int duration = jiffies_to_msecs(jiffies - start_time);
-
+	if (unlikely(p == NULL)) {
 		uds_log_error("Could not allocate %zu bytes for %s in %u msecs",
-			      size,
-			      what,
-			      duration);
+			      size, what, jiffies_to_msecs(jiffies - start_time));
 		return -ENOMEM;
 	}