From: Duan Fugang-B38611 Date: Tue, 3 Sep 2013 02:41:18 +0000 (+0800) Subject: net: fec: fix the error to get the previous BD entry X-Git-Tag: v3.12-rc1~132^2~1^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36e24e2ee29e25480b4be4a9ea467f4739be22fb;p=pandora-kernel.git net: fec: fix the error to get the previous BD entry Bug: error to get the previous BD entry. When the current BD is the first BD, the previous BD entry must be the last BD, not "bdp - 1" in current logic. V4: * Optimize fec_enet_get_nextdesc() for code clean. Replace "ex_new_bd - ring_size" with "ex_base". Replace "new_bd - ring_size" with "base". V3: * Restore the API name because David suggest to use fec_enet_ prefix for all function in fec driver. So, change next_bd() -> fec_enet_get_nextdesc() change pre_bd() -> fec_enet_get_prevdesc() * Reduce the two APIs parameters for easy to call. V2: * Add tx_ring_size and rx_ring_size to struct fec_enet_private. * Replace api fec_enet_get_nextdesc() with next_bd(). Replace api fec_enet_get_prevdesc() with pre_bd(). * Move all ring size check logic to next_bd() and pre_bd(), which simplifies the code redundancy. V1: * Add BD ring size check to get the previous BD entry in correctly. Reviewed-by: Li Frank Signed-off-by: Fugang Duan Acked-by: Frank Li Signed-off-by: David S. Miller --- Reading git-diff-tree failed