Re: [PATCH v4 1/8] mm/util: Introduce kmemdup_array() to duplicate an array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 11, 2023 at 2:17 PM Kartik <kkartik@xxxxxxxxxx> wrote:
>
> Introduce function kmemdup_array(), that will copy `n` number of
> elements from a given array `src` to `dst`.
>
> On success, kmemdup_array() returns 0 and copy the elements from `src`
> to newly allocated array `dst`, it also stores number of elements
> copied from `src` array to `dst_count` parameter. On failure, this
> returns a negative integer value containing the error value.

Hmm... Why is it so complicated?

Can it be as simple as

  return kmemdup(size_mul());

?

--
With Best Regards,
Andy Shevchenko




[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux