Pointer magic in mm_init_cpumask()

2019-08-21 Thread Siarhei Liakh
Hello everyone. I was chasing some issue in my own code when I came across the following in include/linux/mm_types.h: == /* Pointer magic because the dynamic array size confuses some compilers. */ static inline void mm_init_cpumask(struct mm_struct *mm) { unsigned long c

Re: Pointer magic in mm_init_cpumask()

2019-08-21 Thread Rik van Riel
On Wed, 2019-08-21 at 09:13 -0400, Siarhei Liakh wrote: > If mm_cpumask() is not safe, then at the very least the following has > to be fixed: > $ grep -rIn 'cpumask_clear(mm_cpumask(' * > arch/powerpc/include/asm/tlb.h:69:cpumask_clear(mm_cpumask(mm)); > arch/sparc/mm/init_64.c:857:cp