lkml.org 
[lkml]   [2021]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Linux 5.15
On Mon, Nov 1, 2021 at 6:18 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> Replacing "strlen(UTS_RELEASE)" with "sizeof(UTS_RELEASE) - 1" seems to do
> the trick, at least with gcc 11.2 and v5.15. I just wonder if that would be
> acceptable. Any idea ?

Looks sane to me.

I don't understand why gcc complains about that thing in the first
place, much less why it only happens on m68k, but whatever...

The other - and perhaps better - option would be to just uninline
memcpy_and_pad() entirely, move it to lib/string.c, and only have the
declaration in <linux/string.h>.

Because the only reason to have it as an inline function is when the
compiler can statically optimize a call site: but it's really not a
performance-critical function to begin with, and clearly the compiler
instead just *breaks* rather than optimize that call-site.

Linus

\
 
 \ /
  Last update: 2021-11-02 02:45    [W:0.052 / U:2.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site