[PATCH 4/4] Do not multiply/divide RAM sizes by 1024 back and forth

Vratislav Podzimek vpodzime at redhat.com
Fri Jul 25 10:37:02 UTC 2014


It doesn't make sense to multiply the value by 1024 if its only usage divides it
back as the first thing.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 anaconda                    | 10 +++++-----
 pyanaconda/isys/__init__.py | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/anaconda b/anaconda
index 9f1dbb4..4d4676e 100755
--- a/anaconda
+++ b/anaconda
@@ -601,14 +601,14 @@ def check_memory(anaconda, options, display_mode=None):
         display_mode = anaconda.displayMode
 
     reason = reason_strict
-    total_ram = int(isys.total_memory() / 1024)
-    needed_ram = int(isys.MIN_RAM / 1024)
-    graphical_ram = int(isys.MIN_GUI_RAM / 1024)
+    total_ram = int(isys.total_memory())
+    needed_ram = int(isys.MIN_RAM)
+    graphical_ram = int(isys.MIN_GUI_RAM)
 
     # count the squashfs.img in if it is kept in RAM
     if not persistent_root_image():
-        needed_ram += isys.SQUASHFS_RAM
-        graphical_ram += isys.SQUASHFS_RAM
+        needed_ram += isys.SQUASHFS_EXTRA_RAM
+        graphical_ram += isys.SQUASHFS_EXTRA_RAM
 
     log.info("check_memory(): total:%s, needed:%s, graphical:%s",
              total_ram, needed_ram, graphical_ram)
diff --git a/pyanaconda/isys/__init__.py b/pyanaconda/isys/__init__.py
index 06291f6..29e9b24 100644
--- a/pyanaconda/isys/__init__.py
+++ b/pyanaconda/isys/__init__.py
@@ -46,14 +46,14 @@ import logging
 log = logging.getLogger("anaconda")
 
 if blivet.arch.getArch() in ["ppc64", "ppc64le"]:
-    MIN_RAM = 768 * 1024
-    GUI_INSTALL_EXTRA_RAM = 512 * 1024
+    MIN_RAM = 768
+    GUI_INSTALL_EXTRA_RAM = 512
 else:
-    MIN_RAM = 320 * 1024
-    GUI_INSTALL_EXTRA_RAM = 90 * 1024
+    MIN_RAM = 320
+    GUI_INSTALL_EXTRA_RAM = 90
 
 MIN_GUI_RAM = MIN_RAM + GUI_INSTALL_EXTRA_RAM
-SQUASHFS_EXTRA_RAM = 750 * 1024
+SQUASHFS_EXTRA_RAM = 750
 
 ## Flush filesystem buffers.
 def sync ():
-- 
1.9.3



More information about the anaconda-patches mailing list