From: David Laight <David.Laight@ACULAB.COM>
To: 'Andy Shevchenko' <andriy.shevchenko@linux.intel.com>,
Takashi Iwai <tiwai@suse.de>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Jaroslav Kysela" <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Dan Williams <dan.j.williams@intel.com>
Subject: RE: [PATCH v1 1/1] ALSA: korg1212: Re-use sockptr_t and respective APIs
Date: Fri, 21 Jul 2023 13:58:52 +0000 [thread overview]
Message-ID: <b8e6f7ae1e684f85902cb3a787436bd9@AcuMS.aculab.com> (raw)
In-Reply-To: <ZLphAJG4Tz8zLUSN@smile.fi.intel.com>
From: Andy Shevchenko
> Sent: 21 July 2023 11:42
>
> On Fri, Jul 21, 2023 at 12:08:46PM +0200, Takashi Iwai wrote:
> > On Fri, 21 Jul 2023 12:01:46 +0200,
> > Andy Shevchenko wrote:
> > >
> > > The sockptr_t (despite the naming) is a generic type to hold kernel
> > > or user pointer and there are respective APIs to copy data to or
> > > from it. Replace open coded variants in the driver by them.
> >
> > While I see the benefit, I feel this is very confusing. If we use the
> > API for a generic use, it should be renamed at first.
> >
> > Also, the current function actually follows the call pattern, and we
> > know in the caller side whether it's called for a kernel pointer or a
> > user pointer. So, if any, the PCM core callbacks should be revised to
> > use a generic pointer instead of fiddling in each driver side.
>
> Any suggestion for the name?
> And I believe for the bigger series the new callback should be added first.
It would also be better to replace the current sockptr_t with
a structure that contains separate user and kernel addresses
(instead of a union of the pointer types and a flag).
The size of the structure wouldn't change and the code might
even come out better.
There is also scope for adding a length and passing the structure
by reference instead of by value.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
prev parent reply other threads:[~2023-07-21 13:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-21 10:01 Andy Shevchenko
2023-07-21 10:08 ` Takashi Iwai
2023-07-21 10:42 ` Andy Shevchenko
2023-07-21 10:58 ` Takashi Iwai
2023-07-21 12:58 ` Andy Shevchenko
2023-07-21 14:21 ` Takashi Iwai
2023-07-21 13:58 ` David Laight [this message]
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=b8e6f7ae1e684f85902cb3a787436bd9@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=alsa-devel@alsa-project.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dan.j.williams@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=tiwai@suse.de \
/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®