[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZNuEajC4gqoqniEw@smile.fi.intel.com>
Date: Tue, 15 Aug 2023 16:58:02 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Takashi Iwai <tiwai@...e.de>
Cc: alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH 19/25] ASoC: mediatek: Convert to generic PCM copy ops
On Mon, Aug 14, 2023 at 01:55:17PM +0200, Takashi Iwai wrote:
> This patch converts the mediatek BT SCO driver code to use the new
> unified PCM copy callback. It's a straightforward conversion from
> *_user() to *_iter() variants. As copy_form/to_iter() updates the
> internal offset at each read/write, we can drop the cur_*_idx counter
> in the loop, too.
>
> Note that copy_from/to_iter() returns the copied bytes, hence the
> error condition is inverted from copy_from/to_user().
...
> + if (!copy_to_iter(bt->rx_packet_buf + cur_read_idx,
!= read_size ?
> + read_size, buf)) {
> dev_warn(bt->dev, "%s(), copy_to_user fail\n",
Forgot to fix the message.
> __func__);
> return -EFAULT;
...
> + if (!copy_from_iter(bt->tx_packet_buf + cur_write_idx,
> + write_size, buf)) {
> dev_warn(bt->dev, "%s(), copy_from_user fail\n",
> __func__);
> return -EFAULT;
As per above.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists