On 27.09.2022 16:44, Alex Bennée wrote: > Jan Beulich <[email protected]> writes: >> @@ -127,7 +128,7 @@ static int __init extract_lsb_from_nodes >> if ( spdx >= epdx ) >> continue; >> bitfield |= spdx; >> - nodes_used++; >> + nodes_used += i == 0 || !nodeids || nodeids[i - 1] != >> nodeids[i]; > > Is that boolean short cutting worth it instead of a more easily > readable: > > if (i == 0 || !nodeids || nodeids[i - 1] != nodeids[i]) > nodes_used++; > > ?
If others (especially my co-maintainers) agree, I'd be willing to switch. Generally I've come to prefer that form as it often serves as an indication to compilers to try to avoid branches. (That said, I've neither checked that this has this effect here, nor would it really matter much, as this code is run exactly once during boot.) Jan
