Re: [PATCH] Avoid use of the old CPU macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Matz wrote:
> On Wed, 9 May 2018, Stanislav Brabec wrote:
>>  	for (cpu = 0; cpu < setsize; cpu++) {
>> -		if (!CPU_ISSET(cpu, cpu_set))
>> +		if (!CPU_ISSET_S(cpu, setsize, cpu_set))
> 
> Careful, the _S macros count the size in _bytes_, the above loop iterates 
> in nr-of-cpus (i.e. bits), or alternatively if the caller really gives a 
> byte size then the loop iterations don't catch all CPUs.  More instances 
> follow.

setsize passed to the function is CPU_ALLOC_SIZE(maxcpus).

Do I understand correctly that the new !CPU_ISSET_S is correct, but the
loop limit should be maxcpus?

-- 
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



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux