[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87v8doci5h.wl-tiwai@suse.de>
Date: Wed, 09 Aug 2023 18:08:58 +0200
From: Takashi Iwai <tiwai@...e.de>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Takashi Iwai <tiwai@...e.de>,
Christoph Hellwig <hch@....de>,
linux-kernel@...r.kernel.org,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Mark Brown <broonie@...nel.org>,
netdev@...r.kernel.org
Subject: Re: [PATCH RFC] Introduce uniptr_t as a generic "universal" pointer
On Wed, 09 Aug 2023 17:59:20 +0200,
Linus Torvalds wrote:
>
> On Wed, 9 Aug 2023 at 07:44, Takashi Iwai <tiwai@...e.de> wrote:
> >
> > 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
Powered by blists - more mailing lists