summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@gmail.com>2020-04-19 03:10:50 +0200
committermarex <marex@desktop.lan>2020-05-01 12:35:21 +0200
commit5a0c332a8a6fee7deadda5c8439782aa5f7b9ca2 (patch)
tree255379722b0bb318a098410832ec5f9390abc979
parent5b4e7dfb879c4b127f27bd92bac68e114d5e0b70 (diff)
net: dc2114x: Clean up send_setup_frame()
Clean up the send_setup_frame() to bring it up to standards with U-Boot coding style, invert the loops where applicable to cut down the level of indent. 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, 22 insertions, 22 deletions
diff --git a/drivers/net/dc2114x.c b/drivers/net/dc2114x.c
index 6fe05113ca..bd64c75af4 100644
--- a/drivers/net/dc2114x.c
+++ b/drivers/net/dc2114x.c
@@ -396,48 +396,48 @@ static void dc21x4x_halt(struct eth_device *dev)
pci_write_config_byte(devbusfn, PCI_CFDA_PSM, SLEEP);
}
-static void send_setup_frame(struct eth_device* dev, bd_t *bis)
+static void send_setup_frame(struct eth_device *dev, bd_t *bis)
{
- int i;
- char setup_frame[SETUP_FRAME_LEN];
- char *pa = &setup_frame[0];
+ char setup_frame[SETUP_FRAME_LEN];
+ char *pa = &setup_frame[0];
+ int i;
memset(pa, 0xff, SETUP_FRAME_LEN);
for (i = 0; i < ETH_ALEN; i++) {
*(pa + (i & 1)) = dev->enetaddr[i];
- if (i & 0x01) {
+ if (i & 0x01)
pa += 4;
- }
}
- for(i = 0; tx_ring[tx_new].status & cpu_to_le32(T_OWN); i++) {
- if (i >= TOUT_LOOP) {
- printf("%s: tx error buffer not ready\n", dev->name);
- goto Done;
- }
+ for (i = 0; tx_ring[tx_new].status & cpu_to_le32(T_OWN); i++) {
+ if (i < TOUT_LOOP)
+ continue;
+
+ printf("%s: tx error buffer not ready\n", dev->name);
+ return;
}
- tx_ring[tx_new].buf = cpu_to_le32(phys_to_bus((u32) &setup_frame[0]));
- tx_ring[tx_new].des1 = cpu_to_le32(TD_TER | TD_SET| SETUP_FRAME_LEN);
+ tx_ring[tx_new].buf = cpu_to_le32(phys_to_bus((u32)&setup_frame[0]));
+ tx_ring[tx_new].des1 = cpu_to_le32(TD_TER | TD_SET | SETUP_FRAME_LEN);
tx_ring[tx_new].status = cpu_to_le32(T_OWN);
OUTL(dev, POLL_DEMAND, DE4X5_TPD);
- for(i = 0; tx_ring[tx_new].status & cpu_to_le32(T_OWN); i++) {
- if (i >= TOUT_LOOP) {
- printf("%s: tx buffer not ready\n", dev->name);
- goto Done;
- }
+ for (i = 0; tx_ring[tx_new].status & cpu_to_le32(T_OWN); i++) {
+ if (i < TOUT_LOOP)
+ continue;
+
+ printf("%s: tx buffer not ready\n", dev->name);
+ return;
}
if (le32_to_cpu(tx_ring[tx_new].status) != 0x7FFFFFFF) {
- printf("TX error status2 = 0x%08X\n", le32_to_cpu(tx_ring[tx_new].status));
+ printf("TX error status2 = 0x%08X\n",
+ le32_to_cpu(tx_ring[tx_new].status));
}
- tx_new = (tx_new+1) % NUM_TX_DESC;
-Done:
- return;
+ tx_new = (tx_new + 1) % NUM_TX_DESC;
}
/* SROM Read and write routines. */