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

From: Andrew Lunn
Date: Tue Aug 22 2023 - 13:59:20 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