lkml.org 
[lkml]   [2022]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v6] coresight: etm4x: avoid build failure with unrolled loops
From
On 10/07/2022 20:13, Arnd Bergmann wrote:
> On Sat, Jul 9, 2022 at 1:15 AM Nick Desaulniers <ndesaulniers@google.com> wrote:
>
>> ({ \
>> u64 __val; \
>> \
>> - if (__builtin_constant_p((offset))) \
>> + if (__is_constexpr((offset))) \
>> __val = read_etm4x_sysreg_const_offset((offset)); \
>> else \
>> __val = etm4x_sysreg_read((offset), true, (_64bit)); \
>>
>
> This is clearly better than the current version using
> __builtin_constant_p(), but
> I don't think it's safe in all cases, since there are expressions that
> are constant
> expressions to the compiler but are not valid input to the assembler.
>
> I would prefer to see this fixed differently, but doing this one first is also
> fine with me:
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> Arnd


Thanks, I have queued this.

Suzuki

\
 
 \ /
  Last update: 2022-07-11 10:36    [W:0.075 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site