[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whi4n6xvy99U-q_GrR_hHk8es4GtDKtywiL5nRFUWroAQ@mail.gmail.com>
Date: Sun, 20 Feb 2022 12:12:41 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Borislav Petkov <bp@...e.de>
Cc: linux-edac <linux-edac@...r.kernel.org>,
lkml <linux-kernel@...r.kernel.org>
Subject: Re: [GIT PULL] EDAC fix for 5.17
On Sun, Feb 20, 2022 at 3:50 AM Borislav Petkov <bp@...e.de> wrote:
>
> please pull a fix for a long-standing, hard-to-catch issue in the EDAC
> weird struct allocation code, for 5.17.
Heh. Yeah, that was subtly buggy.
Side note: the comment says that it will align to at least as much as
the compiler would do, but then it does something different, eg
if (size > sizeof(long))
align = sizeof(long long);
...
and it might make sense to use "__alignof__()" instead of "sizeof()"
just to make the code match the comment.
For example, on 32-bit x86, "sizeof(long long)" is 8, but
"__alignof__(long long)" is only 4.
And then we have m68k..
Or maybe the comment should be fixed instead, and talk about "natural
alignment" rather than "compiler alignment".
Linus
Powered by blists - more mailing lists