RE: [PATCH net-next v6 1/2] net/ethernet/realtek: Add Realtek automotive PCIe driver code

From: Justin Lai
Date: Wed Aug 23 2023 - 10:28:44 EST


>
> > + 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.