chcpu.c mixed maxcpus (number of cpus) and setsize (size of CPU bit mask). It effectively limits number of CPUs to 1/8 of the supported amount. Signed-off-by: Stanislav Brabec <sbrabec@xxxxxxx> Cc: Michael Matz <matz@xxxxxxx> Cc: Heiko Carstens <heiko.carstens@xxxxxxxxxx> --- sys-utils/chcpu.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys-utils/chcpu.c b/sys-utils/chcpu.c index f32b7a6fc..4b5c7579a 100644 --- a/sys-utils/chcpu.c +++ b/sys-utils/chcpu.c @@ -75,12 +75,12 @@ enum { */ static int cpu_enable(cpu_set_t *cpu_set, size_t setsize, int enable) { - unsigned int cpu; + int cpu; int online, rc; int configured = -1; - size_t fails = 0; + int fails = 0; - for (cpu = 0; cpu < setsize; cpu++) { + for (cpu = 0; cpu < maxcpus; cpu++) { if (!CPU_ISSET_S(cpu, setsize, cpu_set)) continue; if (!path_exist(_PATH_SYS_CPU "/cpu%d", cpu)) { @@ -132,7 +132,7 @@ static int cpu_enable(cpu_set_t *cpu_set, size_t setsize, int enable) } } - return fails == 0 ? 0 : fails == setsize ? -1 : 1; + return fails == 0 ? 0 : fails == maxcpus ? -1 : 1; } static int cpu_rescan(void) @@ -168,11 +168,11 @@ static int cpu_set_dispatch(int mode) */ static int cpu_configure(cpu_set_t *cpu_set, size_t setsize, int configure) { - unsigned int cpu; + int cpu; int rc, current; - size_t fails = 0; + int fails = 0; - for (cpu = 0; cpu < setsize; cpu++) { + for (cpu = 0; cpu < maxcpus; cpu++) { if (!CPU_ISSET_S(cpu, setsize, cpu_set)) continue; if (!path_exist(_PATH_SYS_CPU "/cpu%d", cpu)) { @@ -217,7 +217,7 @@ static int cpu_configure(cpu_set_t *cpu_set, size_t setsize, int configure) } } - return fails == 0 ? 0 : fails == setsize ? -1 : 1; + return fails == 0 ? 0 : fails == maxcpus ? -1 : 1; } static void cpu_parse(char *cpu_string, cpu_set_t *cpu_set, size_t setsize) -- 2.16.3 -- Best Regards / S pozdravem, Stanislav Brabec software developer --------------------------------------------------------------------- SUSE LINUX, s. r. o. e-mail: sbrabec@xxxxxxxx Křižíkova 148/34 (Corso IIa) tel: +49 911 7405384547 186 00 Praha 8-Karlín fax: +420 284 084 001 Czech Republic http://www.suse.cz/ PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76 -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html