netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Atlas Yu <atlas.yu@canonical.com>
Cc: davem@davemloft.net, edumazet@google.com, hau@realtek.com,
	kuba@kernel.org, netdev@vger.kernel.org, nic_swsd@realtek.com,
	pabeni@redhat.com
Subject: Re: DRY rules - extract into rtl_cond_loop_wait_high()
Date: Tue, 26 Mar 2024 21:28:56 +0100	[thread overview]
Message-ID: <146be1ba-c0fb-4ed2-8515-319151b1406b@gmail.com> (raw)
In-Reply-To: <20240326100802.51343-1-atlas.yu@canonical.com>

On 26.03.2024 11:08, Atlas Yu wrote:
> On Tue, Mar 26, 2024 at 5:09 PM Paolo Abeni <pabeni@redhat.com> wrote:
> 
>>>  drivers/net/ethernet/realtek/r8169_main.c | 8 ++++++++
>>>  1 file changed, 8 insertions(+)
>>>
>>> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
>>> index 5c879a5c86d7..a39520a3f41d 100644
>>> --- a/drivers/net/ethernet/realtek/r8169_main.c
>>> +++ b/drivers/net/ethernet/realtek/r8169_main.c
>>> @@ -1317,6 +1317,8 @@ static void rtl8168ep_stop_cmac(struct rtl8169_private *tp)
>>>  static void rtl8168dp_driver_start(struct rtl8169_private *tp)
>>>  {
>>>  	r8168dp_oob_notify(tp, OOB_CMD_DRIVER_START);
>>> +	if (!tp->dash_enabled)
>>> +		return;
>>>  	rtl_loop_wait_high(tp, &rtl_dp_ocp_read_cond, 10000, 10);
>>
>> You are replicating this chunk several times. It would probably be
>> better to create a new helper - say rtl_cond_loop_wait_high() or
>> something similar - and use it where needed.
> 
> Sure, will do, thanks for the suggestion.

cond like conditional would be a little too generic here IMO.
Something like rtl_dash_loop_wait_high()/low() would make clear
that the poll loop is relevant only if DASH is enabled.


  reply	other threads:[~2024-03-26 20:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-22  3:46 [PATCH] r8169: skip DASH fw status checks when DASH is disabled pseudoc
2024-03-22  7:01 ` Heiner Kallweit
2024-03-22  8:16   ` Jiri Pirko
2024-03-22  8:26     ` [PATCH v2] " pseudoc
2024-03-22  9:07       ` Jiri Pirko
2024-03-22  9:20         ` Sorry Jiri Pirko pseudoc
2024-03-22  9:10       ` Sorry for the spam, ignore the previous email please pseudoc
2024-03-26  9:08       ` [PATCH v2] r8169: skip DASH fw status checks when DASH is disabled Paolo Abeni
2024-03-26 10:08         ` DRY rules - extract into rtl_cond_loop_wait_high() Atlas Yu
2024-03-26 20:28           ` Heiner Kallweit [this message]
2024-03-27  2:15             ` DRY rules - extract into inline helper functions Atlas Yu
2024-03-27  6:37               ` Heiner Kallweit
2024-03-22  8:33   ` [PATCH] r8169: skip DASH fw status checks when DASH is disabled pseudoc
2024-03-22 10:16     ` Heiner Kallweit
2024-03-22 10:49       ` Heiner Kallweit Atlas Yu
2024-03-22 12:32         ` r8169 DASH-related issue Heiner Kallweit

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=146be1ba-c0fb-4ed2-8515-319151b1406b@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=atlas.yu@canonical.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hau@realtek.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=pabeni@redhat.com \
    /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).