From f966082e2065d223942cc40e0bc4841f84f0604d Mon Sep 17 00:00:00 2001 From: Claudiu Manoil Date: Mon, 13 Jul 2015 16:22:04 +0300 Subject: [PATCH] gianfar: Fix and cleanup rxbd status handling There are several (long standing) problems about how the status field of the rx buffer descriptor (rxbd) is currently handled on the error path: - too many unnecessary 16bit reads of the two halves of the rxbd status field (32bit), also resulting in overuse of endianness convesion macros; - "bdp->status = RXBD_LARGE" makes no sense, since the "large" flag is read only (only eTSEC can write it), and trying to clear the other status bits is also error prone in this context (most of the rx status bits are read only anyway). This is fixed with a single 32bit read of the "status" field, and then the appropriate 16bit shifting is applied to access the various status bits or the rx frame length. Also corrected the use of the RXBD_LARGE flag. Additional fix: "rx_over_errors" stat is incremented instead of "rx_crc_errors" in case of RXBD_OVERRUN occurrence. Signed-off-by: Claudiu Manoil Signed-off-by: David S. Miller --- Reading git-format-patch failed