netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Justin Lai <justinlai0215@realtek.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "kuba@kernel.org" <kuba@kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"jiri@resnulli.us" <jiri@resnulli.us>
Subject: RE: [PATCH net-next v6 1/2] net/ethernet/realtek: Add Realtek automotive PCIe driver code
Date: Wed, 23 Aug 2023 14:28:20 +0000	[thread overview]
Message-ID: <5ae1444b03f64e7287fc7abb6cd56063@realtek.com> (raw)
In-Reply-To: <aa7e5c75-e337-4150-bba5-a139ab4fc02f@lunn.ch>

> 
> > +     do {
> > +             status = RTL_R32(tp, ivec->isr_addr);
> > +
> > +             handled = 1;
> > +             RTL_W32(tp, ivec->imr_addr, 0x0);
> > +             RTL_W32(tp, ivec->isr_addr, (status & ~FOVW));
> > +
> > +             if ((status & ivec->imr)) {
> > +                     if (likely(napi_schedule_prep(&ivec->napi)))
> > +                             __napi_schedule(&ivec->napi);
> > +             }
> > +     } while (false);
> 
> Remember i said that if you do something which no other network driver does,
> it is probably wrong. How many drivers have a do {} while (false); loop?
> 
> Please spend a few days just reading other drivers, and compare your code
> with those drivers. Try to find all the things your driver does which no other
> driver has. That code is probably wrong and you should fix it.
> 
>         Andrew
> 
Thank you for your suggestions, I will read other drivers and modify some problems of this driver.

  reply	other threads:[~2023-08-23 14:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22  3:18 [PATCH net-next v6 0/2] Add Realtek automotive PCIe driver Justin Lai
2023-08-22  3:18 ` [PATCH net-next v6 1/2] net/ethernet/realtek: Add Realtek automotive PCIe driver code Justin Lai
2023-08-22 17:37   ` Jakub Kicinski
2023-08-23 14:20     ` Justin Lai
2023-08-22 17:51   ` Andrew Lunn
2023-08-23 14:25     ` Justin Lai
2023-08-22 17:59   ` Andrew Lunn
2023-08-23 14:28     ` Justin Lai [this message]
2023-08-22  3:18 ` [PATCH net-next v6 2/2] MAINTAINERS: Add the rtase ethernet driver entry Justin Lai

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=5ae1444b03f64e7287fc7abb6cd56063@realtek.com \
    --to=justinlai0215@realtek.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --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).