Re: [PATCH net-next v1 3/7] ptp: ocp: Refactor ptp_ocp_i2c_notifier_call()

From: Andy Shevchenko

Date: Tue Nov 18 2025 - 13:31:13 EST


On Wed, Nov 12, 2025 at 01:45:31PM +0000, Vadim Fedorenko wrote:
> On 11/11/2025 16:52, Andy Shevchenko wrote:
> > Refactor ptp_ocp_i2c_notifier_call() to avoid unneeded local variable.

...

> the reason we've done it is to avoid iterating over devices and do
> string comparisons for actions we don't care about. We can still avoid
> local variable by changing if condition later in the code, but I'm not
> sure this refactor gives any benefits.

This is definitely a slow path and having less LoCs and straightforward code
flow is important for readability and maintenance. I find my proposed change
useful.

--
With Best Regards,
Andy Shevchenko