genirq/affinity: Improve __irq_build_affinity_masks()