[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wgxtcTbBdtm9ewarth476Wr5vYYnptaWpwdHcML8-xayA@mail.gmail.com>
Date: Sat, 12 Mar 2022 13:43:50 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Michał Mirosław <mirq-linux@...e.qmqm.pl>
Cc: Xiaomeng Tong <xiam0nd.tong@...il.com>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jakob Koschel <jakobkoschel@...il.com>,
Jann Horn <jannh@...gle.com>,
Kees Cook <keescook@...omium.org>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux-MM <linux-mm@...ck.org>, Netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH 2/6] list: add new MACROs to make iterator invisiable
On Sat, Mar 12, 2022 at 2:24 AM Michał Mirosław <mirq-linux@...e.qmqm.pl> wrote:
>
> The source type is not needed for the macros [..]
Ahh. Yeah, as long as we don't do typedefs, it looks like we don't
need to pre-declare the member access types.
I expected that to be required, because function declarations taking
arguments need it, but that's because they create their own scope.
Just doing it in a regular struct (or in this case union) declaration
is fine.
So we would only need that post-declaration.
That said, your naming is wrong. It's not just about "self". It's any
case where the type we iterate over is declared after the type that
has the head.
So I suspect it would be a lot better to just always do it, and not do
that "self vs non-self" distinction.
Linus
Powered by blists - more mailing lists