From: "Barnabás Pőcze" <pobrn@protonmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Xiaomeng Tong <xiam0nd.tong@gmail.com>,
Kees Cook <keescook@chromium.org>,
Jakob Koschel <jakobkoschel@gmail.com>,
Arnd Bergmann <arnd@arndb.de>
Subject: [RFC PATCH v1 0/2] add type-safer list_head wrapper
Date: Fri, 11 Mar 2022 01:32:44 +0000 [thread overview]
Message-ID: <20220311013238.3387227-1-pobrn@protonmail.com> (raw)
As there have been various discussions[1][2] about improving
the current `list_head` facilities, I would like to
propose a type-safe(r), lightweight wrapper: tlist.
The first commit goes into details as to how it works,
lists some of its advantages and disadvantages.
The second commit showcases it in the existing WMI platform driver.
NOTE: these changes are mostly untested! They are purely for showcasing
a possible implementation and API. And they depend on the switch to gnu11.
I would like to get some feedback as to whether/how acceptable this
approach is before going further: writing documentation, tests, and
adding more wrappers around existing `list_head` facilities
(e.g. reverse iteration is not implemented).
If this idea has already been proposed, I apologize,
I must have missed it when I searched for similar patches.
PS. I have tried to select those who may be interested
in this discussion, I may have missed people or added
people who aren't interested. Sorry.
[1]: https://lore.kernel.org/all/20220217184829.1991035-1-jakobkoschel@gmail.com/
[2]: https://lore.kernel.org/all/20220301075839.4156-1-xiam0nd.tong@gmail.com/
And see https://lwn.net/Articles/887097/ for a summary.
Barnabás Pőcze (2):
list: add type-safer list_head wrapper
platform/x86: wmi: use tlist for WMI blocks
drivers/platform/x86/wmi.c | 54 ++++++++++---------------
include/linux/tlist.h | 81 ++++++++++++++++++++++++++++++++++++++
2 files changed, 102 insertions(+), 33 deletions(-)
create mode 100644 include/linux/tlist.h
--
2.35.1
next reply other threads:[~2022-03-11 1:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-11 1:32 Barnabás Pőcze [this message]
2022-03-11 1:32 ` [RFC PATCH v1 1/2] list: " Barnabás Pőcze
2022-03-11 1:42 ` Linus Torvalds
2022-03-11 2:01 ` Linus Torvalds
2022-03-11 2:49 ` Barnabás Pőcze
2022-03-11 5:06 ` Linus Torvalds
2022-03-11 22:15 ` Barnabás Pőcze
2022-03-11 23:45 ` Linus Torvalds
2022-03-11 23:47 ` Linus Torvalds
2022-03-11 2:45 ` Barnabás Pőcze
2022-03-11 1:33 ` [RFC PATCH v1 2/2] platform/x86: wmi: use tlist for WMI blocks Barnabás Pőcze
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220311013238.3387227-1-pobrn@protonmail.com \
--to=pobrn@protonmail.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=jakobkoschel@gmail.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=xiam0nd.tong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®