On 09/08/2018 06:26 AM, Roger Zoellner wrote:
if ((ULONG)req_aff == ~0u) req_aff = affinity_mask;
else if ((LONG) req_aff < 0) req_aff = affinity_mask & req_aff;
In addition to Dmitry's comment, it's notable that these two cases basically become the same thing. ~0u is -1, which would make req_aff a full mask. Though it may also be worth a test if the sign check actually applies to LONG_PTR instead of LONG, since LONG_PTR is 64-bit on 64-bit targets while LONG is 32-bit even on 64-bit targets.