Subject: Re: [PATCH v1 net-next] net: ethernet: mellanox: mlx5: core: Use ERR_CAST() to return

From: Simon Horman <[email-masked]>
Date: Fri, 6 Sep 2024 08:32:14 +0100

On Thu, Aug 29, 2024 at 04:14:04PM +0800, Yan Zhen wrote:
> Using ERR_CAST() is more reasonable and safer, When it is necessary
> to convert the type of an error pointer and return it.
> 
> Signed-off-by: Yan Zhen <[email-masked]>

Thanks,

I agree that this change is correct.
And it seems to be the only case where this change is
relevant in this file.

And, personally, I do see a value in reducing naked casts,
even if the macro is doing much the same thing. Because
using a macro is more expressive about intent.

But, OTOH, I do see that there is a cost in terms of code-churn,
something for the maintainer to weigh-up.

Reviewed-by: Simon Horman <[email-masked]>