From: Jonas Bonn Date: Thu, 25 Nov 2010 02:30:32 +0000 (+0000) Subject: ethoc: remove division from loops X-Git-Tag: v2.6.38-rc1~476^2~428 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a632625c7da7594d059b88dae0e9c591af147ba;p=pandora-kernel.git ethoc: remove division from loops Calculating the BD entry using a modulus operation isn't optimal, especially inside the loop. This patch removes the modulus operations in favour of: i) simply checking for wrapping in the case of cur_rx ii) forcing num_tx to be a power of two and using it to mask out the entry from cur_tx The also prevents possible issues related overflow of the cur_rx and cur_tx counters. Signed-off-by: Jonas Bonn Signed-off-by: David S. Miller --- Reading git-diff-tree failed