netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Richard Cochran <richardcochran@gmail.com>,
	Jonathan Lemon <jonathan.lemon@gmail.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net-next v1 3/7] ptp: ocp: Refactor ptp_ocp_i2c_notifier_call()
Date: Wed, 12 Nov 2025 17:04:29 +0200	[thread overview]
Message-ID: <aRSh_dNeOPFRjXyD@smile.fi.intel.com> (raw)
In-Reply-To: <7ae9b0c0-c84a-4c2c-b2ee-9252e9c411b0@linux.dev>

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



  reply	other threads:[~2025-11-18 18:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-11 16:52 [PATCH v1 0/7] ptp: ocp: A fix and refactoring Andy Shevchenko
2025-11-11 16:52 ` [PATCH net-next v1 1/7] ptp: ocp: Refactor signal_show() and fix %ptT misuse Andy Shevchenko
2025-11-12 13:29   ` Vadim Fedorenko
2025-11-11 16:52 ` [PATCH net-next v1 2/7] ptp: ocp: Make ptp_ocp_unregister_ext() NULL-aware Andy Shevchenko
2025-11-12 13:38   ` Vadim Fedorenko
2025-11-11 16:52 ` [PATCH net-next v1 3/7] ptp: ocp: Refactor ptp_ocp_i2c_notifier_call() Andy Shevchenko
2025-11-12 13:45   ` Vadim Fedorenko
2025-11-12 15:04     ` Andy Shevchenko [this message]
2025-11-11 16:52 ` [PATCH net-next v1 4/7] ptp: ocp: Apply standard pattern for cleaning up loop Andy Shevchenko
2025-11-12 13:36   ` Vadim Fedorenko
2025-11-11 16:52 ` [PATCH net-next v1 5/7] ptp: ocp: Reuse META's PCI vendor ID Andy Shevchenko
2025-11-12 13:37   ` Vadim Fedorenko
2025-11-11 16:52 ` [PATCH net-next v1 6/7] ptp: ocp: Sort headers alphabetically Andy Shevchenko
2025-11-11 16:52 ` [PATCH net-next v1 7/7] ptp: ocp: don't use "proxy" headers Andy Shevchenko
2025-11-12 15:27 ` [PATCH v1 0/7] ptp: ocp: A fix and refactoring Vadim Fedorenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aRSh_dNeOPFRjXyD@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=vadim.fedorenko@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).