From 4d0b6cb59223783decbb080b562e82575197e5c9 Mon Sep 17 00:00:00 2001 From: Junichi Uekawa Date: Fri, 18 Feb 2022 15:06:25 +0900 Subject: [PATCH] system_allocator: Update comments. We don't return None, we return an error. BUG=None TEST=read it Change-Id: Ida7ff2cf758132ac01b56585d1704ba49c2d357e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3474163 Reviewed-by: Daniel Verkamp Tested-by: kokoro Commit-Queue: Junichi Uekawa --- resources/src/system_allocator.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/src/system_allocator.rs b/resources/src/system_allocator.rs index 871e8313c9..6ca90c1c67 100644 --- a/resources/src/system_allocator.rs +++ b/resources/src/system_allocator.rs @@ -53,9 +53,9 @@ pub struct SystemAllocator { } impl SystemAllocator { - /// Creates a new `SystemAllocator` for managing addresses and irq numvers. - /// Can return `None` if `base` + `size` overflows a u64 or if alignment isn't a power - /// of two. + /// Creates a new `SystemAllocator` for managing addresses and irq numbers. + /// Will return an error if `base` + `size` overflows u64 (or allowed + /// maximum for the specific type), or if alignment isn't a power of two. /// pub fn new(config: SystemAllocatorConfig) -> Result { let page_size = pagesize() as u64;