net: ethernet: ti: cpdma: remove used_desc counter
authorGrygorii Strashko <grygorii.strashko@ti.com>
Thu, 4 Aug 2016 15:20:51 +0000 (18:20 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Aug 2016 23:12:17 +0000 (16:12 -0700)
commitaeec3021043b66a1418df416e1ba83def070cef1
tree26b9f3542d1b13f5689778122e9756f70130516c
parent37088f617d5b025b0e3ddd38a48e3b10ca7d89d9
net: ethernet: ti: cpdma: remove used_desc counter

The struct cpdma_desc_pool->used_desc field can be safely removed from
CPDMA driver (and hot patch) because used_descs counter is used just
for pool consistency check at CPDMA deinitialization and now this
check can be re-implemnted using gen_pool_size(pool->gen_pool) !=
gen_pool_avail(pool->gen_pool).
More over, this will allow to get rid of warnings in
cpdma_desc_pool_destro()-> WARN_ON(pool->used_desc) which may happen
because the used_descs is used unprotected, since CPDMA has been
switched to use genalloc, and may get wrong values on SMP.

Hence, remove used_desc from struct cpdma_desc_pool.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/davinci_cpdma.c