[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200918202909.GA2946008@rani.riverdale.lan>
Date: Fri, 18 Sep 2020 16:29:09 -0400
From: Arvind Sankar <nivedita@...m.mit.edu>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Matthew Wilcox <willy@...radead.org>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
Dennis Zhou <dennis@...nel.org>, Tejun Heo <tj@...nel.org>,
Christoph Lameter <cl@...ux.com>,
Linux-MM <linux-mm@...ck.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Kees Cook <keescook@...omium.org>
Subject: Re: [GIT PULL] percpu fix for v5.9-rc6
On Fri, Sep 18, 2020 at 01:14:54PM -0700, Linus Torvalds wrote:
> On Fri, Sep 18, 2020 at 1:02 PM Matthew Wilcox <willy@...radead.org> wrote:
> >
> > I suppose it's not really necessary, we could do offsetof here, right?
>
> Yup, that would make a lot more sense.
>
> But right now, the sizeof() obviously silently works.
In general (i.e. outside the implementation of the macro itself), what
is the preferred way of getting the size of just the header?
1) offsetof(typeof(s),flex)
2) struct_size(s, flex, 0)
3) sizeof(s)
4) new macro that's easier to read than 1 or 2, but makes it clear
what you're doing?
Powered by blists - more mailing lists