Thread (13 messages) flat view 13 messages, 5 authors, 2023-08-14

Re: [PATCH RFC] Introduce uniptr_t as a generic "universal" pointer

From: Takashi Iwai <hidden>
Date: 2023-08-09 16:09:06
Also in: lkml

On Wed, 09 Aug 2023 17:59:20 +0200,
Linus Torvalds wrote:
On Wed, 9 Aug 2023 at 07:44, Takashi Iwai [off-list ref] wrote:
quoted
The remaining question is whether the use of sockptr_t for other
subsystems as a generic pointer is a recommended / acceptable move...
Very much not recommended. sockptr_t is horrible too, but it was (part
of) what made it possible to fix an even worse horrible historical
mistake (ie getting rid of set_fs()).

So I detest sockptr_t. It's garbage. At the very minimum it should
have had the length associated with it, not passed separately.

But it's garbage exactly because it allowed for conversion of some
much much horrid legacy code with fairly minimal impact.

New code does *not* have that excuse.

DO NOT MIX USER AND KERNEL POINTERS. And don't add interfaces that
think such mixing is ok. Pointers should be statically clearly of one
type or the other, and never lied about.

Or you go all the way, and do that whole iterator thing, and make it
very clear that you're doing something truly generic that can be
passed fairly widely along across subsystem boundaries.
OK, it looks like we need to scratch the idea...


Takashi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help