Blame SOURCES/0002-merge-Github-PR36.patch

510200
From ec50cd73f6e0630939f924836ca18414a1f3f72c Mon Sep 17 00:00:00 2001
510200
From: Lyonel Vincent <lyonel@ezix.org>
510200
Date: Sat, 10 Mar 2018 15:12:28 +0100
510200
Subject: [PATCH 02/10] merge Github PR36
510200
510200
cf. https://github.com/lyonel/lshw/pull/36
510200
510200
---
510200
 src/core/cpuinfo.cc | 57 ++++++++++++++++++++++-----------------------
510200
 1 file changed, 28 insertions(+), 29 deletions(-)
510200
510200
diff --git a/src/core/cpuinfo.cc b/src/core/cpuinfo.cc
510200
index 7f5d4b9..4ad3376 100644
510200
--- a/src/core/cpuinfo.cc
510200
+++ b/src/core/cpuinfo.cc
510200
@@ -241,37 +241,36 @@ static void cpuinfo_aarch64(hwNode & node,
510200
 
510200
   if (id == "Features")
510200
     {
510200
-      while (value.length() > 0)
510200
-        {
510200
-          size_t pos = value.find(' ');
510200
-          string capability = (pos==string::npos)?value:value.substr(0, pos);
510200
-          aarch64_features.push_back(capability);
510200
-          if (pos == string::npos)
510200
-            value = "";
510200
-          else
510200
-            value = hw::strip(value.substr(pos));
510200
-        }
510200
-      for(int i=0; i<=currentcpu; i++)
510200
+      hwNode *cpu = getcpu(node, currentcpu);
510200
+      if (cpu)
510200
         {
510200
-          hwNode *cpu = getcpu(node, i);
510200
-          if (cpu)
510200
+          cpu->addHint("logo", string("aarch64"));
510200
+          if (node.getDescription() == "")
510200
+            node.setDescription(aarch64_processor_name);
510200
+          cpu->claim(true);
510200
+
510200
+          while (value.length() > 0)
510200
+            {
510200
+              size_t pos = value.find(' ');
510200
+              string capability = (pos==string::npos)?value:value.substr(0, pos);
510200
+              aarch64_features.push_back(capability);
510200
+              if (pos == string::npos)
510200
+                value = "";
510200
+              else
510200
+                value = hw::strip(value.substr(pos));
510200
+            }
510200
+
510200
+          for(size_t i=0; i < aarch64_features.size(); i++)
510200
             {
510200
-              cpu->addHint("logo", string("aarch64"));
510200
-              if (node.getDescription() == "")
510200
-                node.setDescription(aarch64_processor_name);
510200
-              cpu->claim(true);
510200
-              for(size_t i=0; i < aarch64_features.size(); i++)
510200
-                {
510200
-                  cpu->addCapability(aarch64_features[i]);
510200
-                  cpu->describeCapability("fp", "Floating point instructions");
510200
-                  cpu->describeCapability("asimd", "Advanced SIMD");
510200
-                  cpu->describeCapability("evtstrm", "Event stream");
510200
-                  cpu->describeCapability("aes", "AES instructions");
510200
-                  cpu->describeCapability("pmull", "PMULL instruction");
510200
-                  cpu->describeCapability("sha1", "SHA1 instructions");
510200
-                  cpu->describeCapability("sha2", "SHA2 instructions");
510200
-                  cpu->describeCapability("crc32", "CRC extension");
510200
-                }
510200
+              cpu->addCapability(aarch64_features[i]);
510200
+              cpu->describeCapability("fp", "Floating point instructions");
510200
+              cpu->describeCapability("asimd", "Advanced SIMD");
510200
+              cpu->describeCapability("evtstrm", "Event stream");
510200
+              cpu->describeCapability("aes", "AES instructions");
510200
+              cpu->describeCapability("pmull", "PMULL instruction");
510200
+              cpu->describeCapability("sha1", "SHA1 instructions");
510200
+              cpu->describeCapability("sha2", "SHA2 instructions");
510200
+              cpu->describeCapability("crc32", "CRC extension");
510200
             }
510200
         }
510200
     }
510200
-- 
510200
2.17.1
510200