]> xenbits.xensource.com Git - people/andrewcoop/hwloc.git/commitdiff
Revert "x86: check hwloc_have_cpuid() in the backend instantiate instead of late...
authorBrice Goglin <Brice.Goglin@inria.fr>
Thu, 13 Feb 2014 08:46:35 +0000 (09:46 +0100)
committerBrice Goglin <Brice.Goglin@inria.fr>
Thu, 13 Feb 2014 08:46:35 +0000 (09:46 +0100)
This reverts commit 6a1cb59936460ff798970929f0bd52fa8da2cc00.

Don't require others caller of look_x86() (Xen soon) to manually check
for cpuid availability at runtime.

src/topology-x86.c

index f08564085abfd4e43f83f93818e1085061b422ae..2194f5ef3d8e31be1d6763e4bab1a36753dc05e3 100644 (file)
@@ -830,6 +830,9 @@ int hwloc_look_x86(struct hwloc_topology *topology, unsigned nbprocs, int fulldi
     set_cpubind = fake_set_cpubind;
   }
 
+  if (!hwloc_have_cpuid())
+    goto out;
+
   infos = calloc(nbprocs, sizeof(struct procinfo));
   if (NULL == infos)
     goto out;
@@ -966,10 +969,6 @@ hwloc_x86_component_instantiate(struct hwloc_disc_component *component,
                                const void *_data3 __hwloc_attribute_unused)
 {
   struct hwloc_backend *backend;
-
-  if (!hwloc_have_cpuid())
-    return NULL;
-
   backend = hwloc_backend_alloc(component);
   if (!backend)
     return NULL;