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 <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
This commit is contained in:
Junichi Uekawa 2022-02-18 15:06:25 +09:00 committed by Commit Bot
parent fe6a8ebe90
commit 4d0b6cb592

View file

@ -53,9 +53,9 @@ pub struct SystemAllocator {
} }
impl SystemAllocator { impl SystemAllocator {
/// Creates a new `SystemAllocator` for managing addresses and irq numvers. /// Creates a new `SystemAllocator` for managing addresses and irq numbers.
/// Can return `None` if `base` + `size` overflows a u64 or if alignment isn't a power /// Will return an error if `base` + `size` overflows u64 (or allowed
/// of two. /// maximum for the specific type), or if alignment isn't a power of two.
/// ///
pub fn new(config: SystemAllocatorConfig) -> Result<Self> { pub fn new(config: SystemAllocatorConfig) -> Result<Self> {
let page_size = pagesize() as u64; let page_size = pagesize() as u64;