summary refs log tree commit diff
path: root/resources/src/system_allocator.rs
diff options
context:
space:
mode:
authorZach Reizner <zachr@google.com>2018-10-03 10:22:32 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-10-09 21:14:05 -0700
commit55a9e504beef368bd97e51ffd5a7fa6c034eb8ad (patch)
tree894d8685e2fdfa105ea35d1cb6cfceee06502c7a /resources/src/system_allocator.rs
parent046df60760f3b0691f23c27a7f24a96c9afe8c05 (diff)
downloadcrosvm-55a9e504beef368bd97e51ffd5a7fa6c034eb8ad.tar
crosvm-55a9e504beef368bd97e51ffd5a7fa6c034eb8ad.tar.gz
crosvm-55a9e504beef368bd97e51ffd5a7fa6c034eb8ad.tar.bz2
crosvm-55a9e504beef368bd97e51ffd5a7fa6c034eb8ad.tar.lz
crosvm-55a9e504beef368bd97e51ffd5a7fa6c034eb8ad.tar.xz
crosvm-55a9e504beef368bd97e51ffd5a7fa6c034eb8ad.tar.zst
crosvm-55a9e504beef368bd97e51ffd5a7fa6c034eb8ad.zip
cargo fmt all source code
Now that cargo fmt has landed, run it over everything at once to bring
rust source to the standard formatting.

TEST=cargo test
BUG=None

Change-Id: Ic95a48725e5a40dcbd33ba6d5aef2bd01e91865b
Reviewed-on: https://chromium-review.googlesource.com/1259287
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Diffstat (limited to 'resources/src/system_allocator.rs')
-rw-r--r--resources/src/system_allocator.rs37
1 files changed, 25 insertions, 12 deletions
diff --git a/resources/src/system_allocator.rs b/resources/src/system_allocator.rs
index 4ca04ae..57618ac 100644
--- a/resources/src/system_allocator.rs
+++ b/resources/src/system_allocator.rs
@@ -43,11 +43,16 @@ impl SystemAllocator {
     /// * `mmio_size` - The size of MMIO space.
     /// * `create_gpu_allocator` - If true, enable gpu memory allocation.
     /// * `first_irq` - The first irq number to give out.
-    fn new(io_base: Option<u64>, io_size: Option<u64>,
-           dev_base: u64, dev_size: u64,
-           mmio_base: u64, mmio_size: u64,
-           create_gpu_allocator: bool,
-           first_irq: u32) -> Option<Self> {
+    fn new(
+        io_base: Option<u64>,
+        io_size: Option<u64>,
+        dev_base: u64,
+        dev_size: u64,
+        mmio_base: u64,
+        mmio_size: u64,
+        create_gpu_allocator: bool,
+        first_irq: u32,
+    ) -> Option<Self> {
         let page_size = pagesize() as u64;
         Some(SystemAllocator {
             io_address_space: if let (Some(b), Some(s)) = (io_base, io_size) {
@@ -137,12 +142,20 @@ impl AddressRanges {
         self
     }
 
-    pub fn create_allocator(&self, first_irq: u32,
-                            gpu_allocation: bool) -> Option<SystemAllocator> {
-        SystemAllocator::new(self.io_base, self.io_size,
-                             self.device_base?, self.device_size?,
-                             self.mmio_base?, self.mmio_size?,
-                             gpu_allocation,
-                             first_irq)
+    pub fn create_allocator(
+        &self,
+        first_irq: u32,
+        gpu_allocation: bool,
+    ) -> Option<SystemAllocator> {
+        SystemAllocator::new(
+            self.io_base,
+            self.io_size,
+            self.device_base?,
+            self.device_size?,
+            self.mmio_base?,
+            self.mmio_size?,
+            gpu_allocation,
+            first_irq,
+        )
     }
 }