Blob Blame History Raw
From 20bd6fc0673eeba3e3419f152a66c264ee4335ef Mon Sep 17 00:00:00 2001
From: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Date: Mon, 28 Nov 2016 15:01:15 +0530
Subject: [PATCH 33/43] devtree: Code cleanup

Make function as static function, use hw:strip() for reading
strings from device tree property.

Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 src/core/device-tree.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/device-tree.cc b/src/core/device-tree.cc
index 21bb6d9..05db9f3 100644
--- a/src/core/device-tree.cc
+++ b/src/core/device-tree.cc
@@ -752,7 +752,7 @@ static void scan_devtree_cpu_power(hwNode & core)
     delete it->second;
 }
 
-void add_memory_bank(string name, string path, hwNode & core)
+static void add_memory_bank(string name, string path, hwNode & core)
 {
   struct dirent **dirlist;
   string product;
@@ -773,10 +773,10 @@ void add_memory_bank(string name, string path, hwNode & core)
     if(exists("serial-number"))
       bank.setSerial(hw::strip(get_string("serial-number")));
 
-    product = get_string("part-number");
+    product = hw::strip(get_string("part-number"));
     if(exists("fru-number"))
     {
-      product += " FRU# " + get_string("fru-number");
+      product += " FRU# " + hw::strip(get_string("fru-number"));
     }
     if(product != "")
       bank.setProduct(hw::strip(product));
-- 
2.10.2