[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170406123217.GB5115@ulmo.ba.sec>
Date: Thu, 6 Apr 2017 14:32:17 +0200
From: Thierry Reding <treding@...dia.com>
To: Joao Pinto <Joao.Pinto@...opsys.com>
CC: <davem@...emloft.net>, <clabbe.montjoie@...il.com>,
<niklas.cassel@...s.com>, <julia.lawall@...6.fr>,
<netdev@...r.kernel.org>
Subject: Re: [PATCH 2/4 v3 net-next] net: stmmac: adding multiple buffers for
rx
On Thu, Apr 06, 2017 at 09:49:09AM +0100, Joao Pinto wrote:
[...]
> err_init_rx_buffers:
> - while (--i >= 0)
> - stmmac_free_rx_buffer(priv, i);
> + while (queue >= 0) {
I /think/ this could simply be:
while (queue--) {
...
}
That evaluates before the decrement and hence properly deals with the
case of 0. The difference to your code is that it will skip the first
iteration, but I think that's fine because stmmac_init_rx_buffers()
already cleans up properly, so the queue'th element doesn't have to
be freed again.
Anyway, I think your version will work just as well.
Thierry
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists