]> git.baikalelectronics.ru Git - kernel.git/commit
staging: et131x: Avoid unnecessary calculations in for loop
authorMark Einon <mark.einon@gmail.com>
Mon, 12 Nov 2012 21:16:28 +0000 (21:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2012 23:06:46 +0000 (15:06 -0800)
commit8bcacf4ae5343863ef2d0d1cb7bf6dcdb93a7e97
treec26ef4790a52bb69cab16096411968c4b0f6399d
parent63aa34cf5eb5507b7362723c546a5559e41e95d7
staging: et131x: Avoid unnecessary calculations in for loop

In et131x_rx_dma_memory_alloc(), we loop over fbr_entries - the values of
fbr_align and fbr_chunksize calculated in the loop do not depend on the
loop counter and are the same for all loop iterations.

Take the calculations of these values out of the loop, as we only
need to calculate them once per loop, not once per loop iteration.

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/et131x/et131x.c