Re: [PATCH] net/mlx5: Use kasprintf instead of hand-writing it

2021-04-18 Thread Christophe JAILLET
Le 18/04/2021 à 22:03, Bart Van Assche a écrit : On 4/17/21 12:16 AM, Christophe JAILLET wrote: 'kasprintf()' can replace a kmalloc/strcpy/strcat sequence. It is less verbose and avoid the use of a magic number (64). Anyway, the underlying 'alloc_workqueue()' would only keep the 24 first chars

Re: [PATCH] net/mlx5: Use kasprintf instead of hand-writing it

2021-04-18 Thread Bart Van Assche
On 4/17/21 12:16 AM, Christophe JAILLET wrote: > 'kasprintf()' can replace a kmalloc/strcpy/strcat sequence. > It is less verbose and avoid the use of a magic number (64). > > Anyway, the underlying 'alloc_workqueue()' would only keep the 24 first > chars (i.e. sizeof(struct

[PATCH] net/mlx5: Use kasprintf instead of hand-writing it

2021-04-17 Thread Christophe JAILLET
'kasprintf()' can replace a kmalloc/strcpy/strcat sequence. It is less verbose and avoid the use of a magic number (64). Anyway, the underlying 'alloc_workqueue()' would only keep the 24 first chars (i.e. sizeof(struct workqueue_struct->name) = WQ_NAME_LEN). Signed-off-by: Christophe JAILLET