From c1bfc7204379a0e5bb2274d3fc122d9d4cdb92ec Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Wed, 16 Oct 2024 17:28:16 +0100
Subject: [PATCH] utils: Add doc-comments for xadd, xmul

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 utils.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/utils.c b/utils.c
index 029bb8ad2..3f008df32 100644
--- a/utils.c
+++ b/utils.c
@@ -952,6 +952,10 @@ mount_strerror (int errsv)
     }
 }
 
+/*
+ * Return a + b if it would not overflow.
+ * Die with an "out of memory" error if it would.
+ */
 static size_t
 xadd (size_t a, size_t b)
 {
@@ -961,6 +965,10 @@ xadd (size_t a, size_t b)
   return result;
 }
 
+/*
+ * Return a * b if it would not overflow.
+ * Die with an "out of memory" error if it would.
+ */
 static size_t
 xmul (size_t a, size_t b)
 {
-- 
GitLab