On Mon, Oct 26, 2020 at 5:55 PM Mark Rutland <mark.rutl...@arm.com> wrote: > On Mon, Oct 26, 2020 at 05:03:29PM +0100, Arnd Bergmann wrote: > > From: Arnd Bergmann <a...@arndb.de> > > > > When CONFIG_COMPAT_VDSO is disabled, we get a warning > > about a potential out-of-bounds access: > > > > arch/arm64/kernel/vdso.c: In function 'aarch32_vdso_mremap': > > arch/arm64/kernel/vdso.c:86:37: warning: array subscript 1 is above array > > bounds of 'struct vdso_abi_info[1]' [-Warray-bounds] > > 86 | unsigned long vdso_size = vdso_info[abi].vdso_code_end - > > | ~~~~~~~~~^~~~~ > > > > This is all in dead code however that the compiler is unable to > > eliminate by itself. > > > > Change the array to individual local variables that can be > > dropped in dead code elimination to let the compiler understand > > this better. > > > > Fixes: 0cbc2659123e ("arm64: vdso32: Remove a bunch of #ifdef > > CONFIG_COMPAT_VDSO guards") > > Signed-off-by: Arnd Bergmann <a...@arndb.de> > > This looks like a nice cleanup to me! I agree we don't need the array > here. > > Reviewed-by: Mark Rutland <mark.rutl...@arm.com>
Thanks! I see the patch now conflicts with "mm: forbid splitting special mappings" in -mm, by Dmitry Safonov. I have rebased my patch on top, should I send it to Andrew for inclusion in -mm then? Arnd