summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@gmail.com>2020-04-19 03:10:25 +0200
committermarex <marex@desktop.lan>2020-05-01 12:35:21 +0200
commit9308df81a206e73687a8ba7a1f1b3753e2f2fd79 (patch)
tree92d33ea9743e0c7555d04ce97a134fd7d832e7ab
parent7c53e3364e4dc7dc4752a75f18a3d72548098365 (diff)
net: dc2114x: Clean up dc21x4x_recv()
Clean up the driver recv code to bring it up to standards with U-Boot coding style. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
-rw-r--r--drivers/net/dc2114x.c44
1 files changed, 19 insertions, 25 deletions
diff --git a/drivers/net/dc2114x.c b/drivers/net/dc2114x.c
index 11ebea9c1a..4d2e11672e 100644
--- a/drivers/net/dc2114x.c
+++ b/drivers/net/dc2114x.c
@@ -346,46 +346,40 @@ done:
return status;
}
-static int dc21x4x_recv(struct eth_device* dev)
+static int dc21x4x_recv(struct eth_device *dev)
{
- s32 status;
- int length = 0;
+ int length = 0;
+ u32 status;
- for ( ; ; ) {
- status = (s32)le32_to_cpu(rx_ring[rx_new].status);
+ while (true) {
+ status = le32_to_cpu(rx_ring[rx_new].status);
- if (status & R_OWN) {
+ if (status & R_OWN)
break;
- }
if (status & RD_LS) {
- /* Valid frame status.
- */
+ /* Valid frame status. */
if (status & RD_ES) {
-
- /* There was an error.
- */
+ /* There was an error. */
printf("RX error status = 0x%08X\n", status);
} else {
- /* A valid frame received.
- */
- length = (le32_to_cpu(rx_ring[rx_new].status) >> 16);
-
- /* Pass the packet up to the protocol
- * layers.
- */
- net_process_received_packet(
- net_rx_packets[rx_new], length - 4);
+ /* A valid frame received. */
+ length = (le32_to_cpu(rx_ring[rx_new].status)
+ >> 16);
+
+ /* Pass the packet up to the protocol layers */
+ net_process_received_packet
+ (net_rx_packets[rx_new], length - 4);
}
- /* Change buffer ownership for this frame, back
- * to the adapter.
+ /*
+ * Change buffer ownership for this frame,
+ * back to the adapter.
*/
rx_ring[rx_new].status = cpu_to_le32(R_OWN);
}
- /* Update entry information.
- */
+ /* Update entry information. */
rx_new = (rx_new + 1) % rxRingSize;
}