python: xc: fix max_cpu_index sign error

When 0-indexing, maximum index is num_entries - 1. The python xc library had a
sign error where the minus was replaced by a plus, making tools that depended
on it to look for CPUs that did not exist.

Signed-off-by: Petre Eftime <epetre@amazon.com>
Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
This commit is contained in:
Petre Eftime authored and Wei Liu committed 2018-04-06 09:05:28 +01:00
1 parent 9ee6308d5b
commit 3bc9c4f98a
1 file changed
+1 -1
+1 -1
View File
@@ -1079,7 +1079,7 @@ static PyObject *pyxc_topologyinfo(XcObject *self)
}
}
ret_obj = Py_BuildValue("{s:i}", "max_cpu_index", num_cpus + 1);
ret_obj = Py_BuildValue("{s:i}", "max_cpu_index", num_cpus - 1);
PyDict_SetItemString(ret_obj, "cpu_to_core", cpu_to_core_obj);
Py_DECREF(cpu_to_core_obj);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.