PEL:Skip assigning id to hostboot PELs

As hostboot will be managing their own PEL Ids skip assigning
id to its PELs.

Signed-off-by: Sumit Kumar <sumit_kumar@in.ibm.com>
Change-Id: I43dc6a2fbf5ec13458d12572b766cc5aa5d8e01b
diff --git a/extensions/openpower-pels/manager.cpp b/extensions/openpower-pels/manager.cpp
index afd7eb0..1372bf6 100644
--- a/extensions/openpower-pels/manager.cpp
+++ b/extensions/openpower-pels/manager.cpp
@@ -130,8 +130,14 @@
     auto pel = std::make_unique<openpower::pels::PEL>(pelData, obmcLogID);
     if (pel->valid())
     {
-        // PELs created by others still need these fields set by us.
-        pel->assignID();
+        // Assign Id other than to Hostbot PEL
+        if ((pel->privateHeader()).creatorID() !=
+            static_cast<uint8_t>(CreatorID::hostboot))
+        {
+            pel->assignID();
+        }
+
+        // PELs created by others still need this field set by us.
         pel->setCommitTime();
 
         // Update System Info to Extended User Data
diff --git a/extensions/openpower-pels/tools/peltool.cpp b/extensions/openpower-pels/tools/peltool.cpp
index 9c034fc..fcea8af 100644
--- a/extensions/openpower-pels/tools/peltool.cpp
+++ b/extensions/openpower-pels/tools/peltool.cpp
@@ -84,7 +84,7 @@
     {
         try
         {
-            tmp.yearMSB = std::stoi(token.substr(i, 2), 0, 16);
+            tmp.yearMSB = std::stoul(token.substr(i, 2), 0, 16);
         }
         catch (std::exception& err)
         {
@@ -93,7 +93,7 @@
         i += 2;
         try
         {
-            tmp.yearLSB = std::stoi(token.substr(i, 2), 0, 16);
+            tmp.yearLSB = std::stoul(token.substr(i, 2), 0, 16);
         }
         catch (std::exception& err)
         {
@@ -102,7 +102,7 @@
         i += 2;
         try
         {
-            tmp.month = std::stoi(token.substr(i, 2), 0, 16);
+            tmp.month = std::stoul(token.substr(i, 2), 0, 16);
         }
         catch (std::exception& err)
         {
@@ -111,7 +111,7 @@
         i += 2;
         try
         {
-            tmp.day = std::stoi(token.substr(i, 2), 0, 16);
+            tmp.day = std::stoul(token.substr(i, 2), 0, 16);
         }
         catch (std::exception& err)
         {
@@ -120,7 +120,7 @@
         i += 2;
         try
         {
-            tmp.hour = std::stoi(token.substr(i, 2), 0, 16);
+            tmp.hour = std::stoul(token.substr(i, 2), 0, 16);
         }
         catch (std::exception& err)
         {
@@ -129,7 +129,7 @@
         i += 2;
         try
         {
-            tmp.minutes = std::stoi(token.substr(i, 2), 0, 16);
+            tmp.minutes = std::stoul(token.substr(i, 2), 0, 16);
         }
         catch (std::exception& err)
         {
@@ -138,7 +138,7 @@
         i += 2;
         try
         {
-            tmp.seconds = std::stoi(token.substr(i, 2), 0, 16);
+            tmp.seconds = std::stoul(token.substr(i, 2), 0, 16);
         }
         catch (std::exception& err)
         {
@@ -147,7 +147,7 @@
         i += 2;
         try
         {
-            tmp.hundredths = std::stoi(token.substr(i, 2), 0, 16);
+            tmp.hundredths = std::stoul(token.substr(i, 2), 0, 16);
         }
         catch (std::exception& err)
         {
@@ -167,7 +167,7 @@
     uint32_t num = 0;
     try
     {
-        num = std::stoi(fileName.substr(fileName.find("_") + 1), 0, 16);
+        num = std::stoul(fileName.substr(fileName.find("_") + 1), 0, 16);
     }
     catch (std::exception& err)
     {