Re: [PATCH 2/2] net/mlx4: avoid overloading user/kernel pointers

From: Arnd Bergmann
Date: Thu Apr 20 2023 - 04:55:55 EST


On Wed, Apr 19, 2023, at 09:09, Tariq Toukan wrote:
> On 18/04/2023 14:47, Arnd Bergmann wrote:
>
> Now we should maintain the values of the two pointers before any call.
> I'm not sure this is less error-prune. One can mistakenly update
> kbuf_addr for example without nullifying ubuf_addr.

That would cause a compiler warning about the uninitialized variable.

> Also, I'm not a big fan of passing two pointers when exactly one of them
> is effectively used.
> We can think maybe of passing a union of both types, and a boolean
> indicating which pointer type is to be used.

This is basically what you have today. I've dropped this patch from
my randconfig tree and will ignore the problem.

Arnd