On 31/07/2019 14:12, Jan Beulich wrote: > On 31.07.2019 14:49, Andrew Cooper wrote: >> I don't see a way to avoid expanding node twice, but given that its wrapper >> is in ALL_CAPS and obviously a macro. >> >> Furthermore, experimenting with a deliberate attempt to provoke this, I got >> >> numa.c: In function ‘numa_initmem_init’: >> >> /local/xen.git/xen/include/xen/nodemask.h:90:10: error: nonconstant array >> index in initializer >> >> [(node) / BITS_PER_LONG] = 1UL << ((node) % BITS_PER_LONG) \ >> >> ^ >> >> numa.c:274:23: note: in expansion of macro ‘NODEMASK_OF’ >> >> node_online_map = NODEMASK_OF(foo++); >> >> ^~~~~~~~~~~ >> >> /local/xen.git/xen/include/xen/nodemask.h:90:10: note: (near initialization >> for ‘(anonymous).bits’) >> >> [(node) / BITS_PER_LONG] = 1UL << ((node) % BITS_PER_LONG) \ >> >> ^ >> >> numa.c:274:23: note: in expansion of macro ‘NODEMASK_OF’ >> >> node_online_map = NODEMASK_OF(foo++); >> >> ^~~~~~~~~~~ >> >> from GCC 6.3, which I think covers everything we need, and will prevent side >> effects from double expansion in practice. > Ah, right. With this my R-b applies to the change as is (with the > additional adjustments folded in that you've pointed out).
I've actually tweaked it a fraction more to not bifurcate NODEMASK_OF() in an ifdef, which means we'll get diagnostics like that out of the compiler even when I haven't hacked NODES_SHIFT to 7 locally. However, it now touches ARM code so I'll post a full v4 series with this and later issues in the series addressed. ~Andrew _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
