lkml.org 
[lkml]   [2022]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: gcc-12: build errors: arch/arm64/kernel/setup.c:225:56: warning: array subscript -1 is outside array bounds of 'char[]' [-Warray-bounds]
On Mon, Jun 6, 2022 at 11:41 AM Mark Rutland <mark.rutland@arm.com> wrote:
> On Fri, Jun 03, 2022 at 09:40:07AM +0200, Arnd Bergmann wrote:
>
> #define va_init_begin() RELOC_HIDE((unsigned long)__init_begin)
>
> ... which'd be a pain, but at least it'd solve this generally.
>
> > I think the easy fix would be to reword this line to
> >
> > kernel_code.end = __pa_symbol(__init_begin) - 1;
> >
>
> I agree that'd work for the __pa_symbol() cases.
>
> For consistency it might be worth using RELOC_HIDE(), e.g.
>
> kernel_code.end = __pa_symbol(RELOC_HIDE(__init_begin)) - 1);
>asm-gener
> ... which IIUC should do the trick.
>

I see we have similar logic on each architecture, and they probably
all have the same
issue now, so maybe we can just do a helper function in include/linux/ioport.h
(which has all the struct resource logic) that can be called like

resource_set_pa(&kernel_code, _stext, __init_begin);
resource_set_pa(&kernel_data, _sdata, _end);

Arnd

\
 
 \ /
  Last update: 2022-06-08 09:26    [W:0.069 / U:0.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site