[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZNuC4qKYOR4piQQU@smile.fi.intel.com>
Date: Tue, 15 Aug 2023 16:51:30 +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
Subject: Re: [PATCH 03/25] ALSA: core: Add memory copy helpers between
iov_iter and iomem
On Mon, Aug 14, 2023 at 01:55:01PM +0200, Takashi Iwai wrote:
> Add two more helpers for copying memory between iov_iter and iomem,
> which will be used by the new PCM copy ops in a few drivers.
> The existing helpers became wrappers of those now.
>
> Note that copy_from/to_iter() returns the copied bytes, hence the
> error condition is inverted from copy_from/to_user().
...
> - return copy_to_user(dst, (const void __force*)src, count) ? -EFAULT : 0;
> + return !copy_to_iter((const void __force *)src, count, dst) ? -EFAULT : 0;
Inverted means, I believe, this
return copy_to_iter((const void __force *)src, count, dst) == count ? 0 : -EFAULT;
as far as I understand the idea behind the copy_to_user() return value.
Ditto for other cases.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists