[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210206123815.213b27ec@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Sat, 6 Feb 2021 12:38:15 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Joakim Zhang <qiangqing.zhang@....com>
Cc: peppe.cavallaro@...com, alexandre.torgue@...com,
joabreu@...opsys.com, davem@...emloft.net, netdev@...r.kernel.org,
linux-imx@....com
Subject: Re: [PATCH V4 net 5/5] net: stmmac: re-init rx buffers when mac
resume back
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?
Powered by blists - more mailing lists