Re: [QUEUED v20180920 15/16] lib: Add memcat_p(): paste 2 pointer arrays together

From: Greg Kroah-Hartman
Date: Thu Sep 20 2018 - 09:00:08 EST


On Thu, Sep 20, 2018 at 03:45:52PM +0300, Alexander Shishkin wrote:
> This adds a helper to paste 2 pointer arrays together, useful for merging
> various types of attribute arrays. There are a few places in the kernel
> tree where this is open coded, and I just added one more in the STM class.
>
> The naming is inspired by memset_p() and memcat(), and partial credit for
> it goes to Andy Shevchenko.
>
> This patch adds the function wrapped in a type-enforcing macro and a test
> module.
>
> Signed-off-by: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
> Cc: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

It would be good to get someone else to review/ack a core function like
this, to verify nothing is incorrect. Especially given the fun of
off-by-one issues in C we have had over the years...

thanks,

greg k-h