Commit dab3166d authored by Kenneth Raffenetti's avatar Kenneth Raffenetti Committed by Pavan Balaji
Browse files

warning squashes for hwloc


Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@mcs.anl.gov>
parent 21118ef9
......@@ -97,7 +97,7 @@ static int hwloc_append_diff_obj_attr_string(hwloc_obj_t obj,
static int hwloc_append_diff_obj_attr_uint64(hwloc_obj_t obj,
hwloc_topology_diff_obj_attr_type_t type,
hwloc_uint64_t index,
hwloc_uint64_t idx,
hwloc_uint64_t oldvalue,
hwloc_uint64_t newvalue,
hwloc_topology_diff_t *firstdiffp,
......@@ -116,7 +116,7 @@ static int hwloc_append_diff_obj_attr_uint64(hwloc_obj_t obj,
newdiff->obj_attr.obj_depth = obj->depth;
newdiff->obj_attr.obj_index = obj->logical_index;
newdiff->obj_attr.diff.uint64.type = type;
newdiff->obj_attr.diff.uint64.index = index;
newdiff->obj_attr.diff.uint64.index = idx;
newdiff->obj_attr.diff.uint64.oldvalue = oldvalue;
newdiff->obj_attr.diff.uint64.newvalue = newvalue;
hwloc_append_diff(newdiff, firstdiffp, lastdiffp);
......
......@@ -4435,6 +4435,7 @@ hwloc_look_linuxfs_pci(struct hwloc_backend *backend)
unsigned os_index;
char path[64];
char value[16];
size_t dummy __hwloc_attribute_unused;
FILE *file;
if (sscanf(dirent->d_name, "%04x:%02x:%02x.%01x", &domain, &bus, &dev, &func) != 4)
......@@ -4463,35 +4464,35 @@ hwloc_look_linuxfs_pci(struct hwloc_backend *backend)
snprintf(path, sizeof(path), "/sys/bus/pci/devices/%s/vendor", dirent->d_name);
file = hwloc_fopen(path, "r", root_fd);
if (file) {
fread(value, sizeof(value), 1, file);
dummy = fread(value, sizeof(value), 1, file);
fclose(file);
attr->vendor_id = strtoul(value, NULL, 16);
}
snprintf(path, sizeof(path), "/sys/bus/pci/devices/%s/device", dirent->d_name);
file = hwloc_fopen(path, "r", root_fd);
if (file) {
fread(value, sizeof(value), 1, file);
dummy = fread(value, sizeof(value), 1, file);
fclose(file);
attr->device_id = strtoul(value, NULL, 16);
}
snprintf(path, sizeof(path), "/sys/bus/pci/devices/%s/class", dirent->d_name);
file = hwloc_fopen(path, "r", root_fd);
if (file) {
fread(value, sizeof(value), 1, file);
dummy = fread(value, sizeof(value), 1, file);
fclose(file);
attr->class_id = strtoul(value, NULL, 16) >> 8;
}
snprintf(path, sizeof(path), "/sys/bus/pci/devices/%s/subsystem_vendor", dirent->d_name);
file = hwloc_fopen(path, "r", root_fd);
if (file) {
fread(value, sizeof(value), 1, file);
dummy = fread(value, sizeof(value), 1, file);
fclose(file);
attr->subvendor_id = strtoul(value, NULL, 16);
}
snprintf(path, sizeof(path), "/sys/bus/pci/devices/%s/subsystem_device", dirent->d_name);
file = hwloc_fopen(path, "r", root_fd);
if (file) {
fread(value, sizeof(value), 1, file);
dummy = fread(value, sizeof(value), 1, file);
fclose(file);
attr->subdevice_id = strtoul(value, NULL, 16);
}
......@@ -4505,7 +4506,7 @@ hwloc_look_linuxfs_pci(struct hwloc_backend *backend)
/* initialize the config space in case we fail to read it (missing permissions, etc). */
memset(config_space_cache, 0xff, CONFIG_SPACE_CACHESIZE);
(void) fread(config_space_cache, 1, CONFIG_SPACE_CACHESIZE, file);
dummy = fread(config_space_cache, 1, CONFIG_SPACE_CACHESIZE, file);
fclose(file);
/* is this a bridge? */
......
......@@ -967,17 +967,19 @@ hwloc_insert_object_by_parent(struct hwloc_topology *topology, hwloc_obj_t paren
if (obj->cpuset && (!curcpuset || hwloc_bitmap_compare_first(obj->cpuset, curcpuset) < 0)) {
static int reported = 0;
if (!reported && !hwloc_hide_errors()) {
char *a = "NULL", *b;
if (curcpuset)
hwloc_bitmap_asprintf(&a, curcpuset);
char *a, *b;
hwloc_bitmap_asprintf(&b, obj->cpuset);
fprintf(stderr, "****************************************************************************\n");
fprintf(stderr, "* hwloc has encountered an out-of-order topology discovery.\n");
fprintf(stderr, "* An object with cpuset %s was inserted after object with %s\n", b, a);
if (curcpuset) {
hwloc_bitmap_asprintf(&a, curcpuset);
fprintf(stderr, "* An object with cpuset %s was inserted after object with %s\n", b, a);
free(a);
} else {
fprintf(stderr, "* An object with cpuset %s was inserted after object with NULL\n", b);
}
fprintf(stderr, "* Please check that your input topology (XML file, etc.) is valid.\n");
fprintf(stderr, "****************************************************************************\n");
if (curcpuset)
free(a);
free(b);
reported = 1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment