From: Havard Skinnemoen Date: Wed, 31 Oct 2012 06:04:55 +0000 (+0000) Subject: net/macb: clean up ring buffer logic X-Git-Tag: omap-for-v3.8/fixes-for-merge-window-v4-signed~45^2~504 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55054a16a5ecf7202e698b07f00ad8e0dadf7d50;p=pandora-kernel.git net/macb: clean up ring buffer logic Instead of masking head and tail every time we increment them, just let them wrap through UINT_MAX and mask them when subscripting. Add simple accessor functions to do the subscripting properly to minimize the chances of messing this up. This makes the code slightly smaller, and hopefully faster as well. Also, doing the ring buffer management this way will simplify things a lot when making the ring sizes configurable in the future. Available number of descriptors in ring buffer function by David Laight. Signed-off-by: Havard Skinnemoen [nicolas.ferre@atmel.com: split patch in topics, adapt to newer kernel] Signed-off-by: Nicolas Ferre Tested-by: Joachim Eastwood Signed-off-by: David S. Miller --- Reading git-diff-tree failed