[lvc-project] [PATCH v1 3/3] net/ethtool/ioctl: correct & simplify ethtool_get_phy_stats if checks
Daniil Tatianin
d-tatianin at yandex-team.ru
Mon Nov 28 16:37:17 MSK 2022
On 11/28/22 4:35 PM, Andrew Lunn wrote:
>> I guess this does indeed look cleaner although I'm not sure about the
>> duplicated n_stats validation code. Maybe this could be moved to a separate
>> helper as well or do you think it's okay to duplicate it in this case?
>
> Yes, the validation and the memory allocation could be pulled out into
> a helper.
>
> The main thing here is that the code is pretty much identical for the
> two functions. If one is correct, the other is also correct. There is
> no access in an else branch which can be overlooked.
>
Yeah, I agree. I'll see what I can come up with. Thanks
More information about the lvc-project
mailing list