On Thu, 4 Feb 2021 19:21:44 +0800 Joakim Zhang wrote: > +err_reinit_rx_buffers: > + while (queue >= 0) { > + while (--i >= 0) > + stmmac_free_rx_buffer(priv, queue, i); > + > + if (queue == 0) > + break; > + > + i = priv->dma_rx_size; > + queue--; > + }
nit: do { ... } while (queue-- > 0); > + > + return -ENOMEM; the caller ignores the return value anyway, so you make make this function void. I'm not sure why you recycle and reallocate every buffer. Isn't it enough to reinitialize the descriptors with the buffers which are already allocated?