Commit 9b1af46b authored by Bilel DRIRA's avatar Bilel DRIRA Committed by Greg Kroah-Hartman

staging: ft1000: fix braces warning

This patch fix checkpatch.pl WARNING:

 WARNING: braces {} are not necessary for single statement blocks
Signed-off-by: default avatarBilel DRIRA <bilel.dr@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c4d50767
...@@ -204,11 +204,11 @@ static inline void ft1000_write_dpram_mag_16(struct net_device *dev, ...@@ -204,11 +204,11 @@ static inline void ft1000_write_dpram_mag_16(struct net_device *dev,
/* Provide mutual exclusive access while reading ASIC registers. */ /* Provide mutual exclusive access while reading ASIC registers. */
spin_lock_irqsave(&info->dpram_lock, flags); spin_lock_irqsave(&info->dpram_lock, flags);
ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, offset); ft1000_write_reg(dev, FT1000_REG_DPRAM_ADDR, offset);
if (Index) { if (Index)
ft1000_write_reg(dev, FT1000_REG_MAG_DPDATAL, value); ft1000_write_reg(dev, FT1000_REG_MAG_DPDATAL, value);
} else { else
ft1000_write_reg(dev, FT1000_REG_MAG_DPDATAH, value); ft1000_write_reg(dev, FT1000_REG_MAG_DPDATAH, value);
}
spin_unlock_irqrestore(&info->dpram_lock, flags); spin_unlock_irqrestore(&info->dpram_lock, flags);
} }
...@@ -440,9 +440,8 @@ static int ft1000_reset_card(struct net_device *dev) ...@@ -440,9 +440,8 @@ static int ft1000_reset_card(struct net_device *dev)
tempword = tempword =
ft1000_read_dpram_mag_16(dev, FT1000_MAG_DPRAM_FEFE, ft1000_read_dpram_mag_16(dev, FT1000_MAG_DPRAM_FEFE,
FT1000_MAG_DPRAM_FEFE_INDX); FT1000_MAG_DPRAM_FEFE_INDX);
if (tempword == 0xfefe) { if (tempword == 0xfefe)
break; break;
}
mdelay(20); mdelay(20);
} }
...@@ -621,9 +620,9 @@ static void ft1000_hbchk(u_long data) ...@@ -621,9 +620,9 @@ static void ft1000_hbchk(u_long data)
tempword = ft1000_read_reg(dev, FT1000_REG_DOORBELL); tempword = ft1000_read_reg(dev, FT1000_REG_DOORBELL);
/* Let's check doorbell again if fail */ /* Let's check doorbell again if fail */
if (tempword & FT1000_DB_HB) { if (tempword & FT1000_DB_HB)
tempword = ft1000_read_reg(dev, FT1000_REG_DOORBELL); tempword = ft1000_read_reg(dev, FT1000_REG_DOORBELL);
}
if (tempword & FT1000_DB_HB) { if (tempword & FT1000_DB_HB) {
pr_info("heartbeat doorbell not clear by firmware\n"); pr_info("heartbeat doorbell not clear by firmware\n");
if (info->AsicID == ELECTRABUZZ_ID) { if (info->AsicID == ELECTRABUZZ_ID) {
...@@ -766,9 +765,8 @@ static void ft1000_send_cmd(struct net_device *dev, u16 *ptempbuffer, int size, ...@@ -766,9 +765,8 @@ static void ft1000_send_cmd(struct net_device *dev, u16 *ptempbuffer, int size,
size += sizeof(struct pseudo_hdr); size += sizeof(struct pseudo_hdr);
/* check for odd byte and increment to 16-bit word align value */ /* check for odd byte and increment to 16-bit word align value */
if ((size & 0x0001)) { if ((size & 0x0001))
size++; size++;
}
pr_debug("total length = %d\n", size); pr_debug("total length = %d\n", size);
pr_debug("length = %d\n", ntohs(*ptempbuffer)); pr_debug("length = %d\n", ntohs(*ptempbuffer));
/* /*
...@@ -911,9 +909,8 @@ static bool ft1000_receive_cmd(struct net_device *dev, u16 *pbuffer, ...@@ -911,9 +909,8 @@ static bool ft1000_receive_cmd(struct net_device *dev, u16 *pbuffer,
* Calculate pseudo header checksum * Calculate pseudo header checksum
*/ */
tempword = *ppseudohdr++; tempword = *ppseudohdr++;
for (i = 1; i < 7; i++) { for (i = 1; i < 7; i++)
tempword ^= *ppseudohdr++; tempword ^= *ppseudohdr++;
}
if ((tempword != *ppseudohdr)) { if ((tempword != *ppseudohdr)) {
pr_debug("Pseudo header checksum mismatch\n"); pr_debug("Pseudo header checksum mismatch\n");
/* Drop this message */ /* Drop this message */
...@@ -977,9 +974,8 @@ static void ft1000_proc_drvmsg(struct net_device *dev) ...@@ -977,9 +974,8 @@ static void ft1000_proc_drvmsg(struct net_device *dev)
while (tempword & FT1000_DB_DPRAM_TX) { while (tempword & FT1000_DB_DPRAM_TX) {
mdelay(5); mdelay(5);
i++; i++;
if (i == 10) { if (i == 10)
break; break;
}
} }
ptr = ptr =
list_entry(info->prov_list.next, list_entry(info->prov_list.next,
...@@ -1099,9 +1095,8 @@ static void ft1000_proc_drvmsg(struct net_device *dev) ...@@ -1099,9 +1095,8 @@ static void ft1000_proc_drvmsg(struct net_device *dev)
mdelay(10); mdelay(10);
tempword = tempword =
ft1000_read_reg(dev, FT1000_REG_DOORBELL); ft1000_read_reg(dev, FT1000_REG_DOORBELL);
if (tempword & FT1000_DB_DPRAM_TX) { if (tempword & FT1000_DB_DPRAM_TX)
mdelay(10); mdelay(10);
}
} }
if ((tempword & FT1000_DB_DPRAM_TX) == 0) { if ((tempword & FT1000_DB_DPRAM_TX) == 0) {
...@@ -1128,9 +1123,9 @@ static void ft1000_proc_drvmsg(struct net_device *dev) ...@@ -1128,9 +1123,9 @@ static void ft1000_proc_drvmsg(struct net_device *dev)
ppseudo_hdr->portsrc = 0; ppseudo_hdr->portsrc = 0;
/* Calculate new checksum */ /* Calculate new checksum */
ppseudo_hdr->checksum = *pmsg++; ppseudo_hdr->checksum = *pmsg++;
for (i = 1; i < 7; i++) { for (i = 1; i < 7; i++)
ppseudo_hdr->checksum ^= *pmsg++; ppseudo_hdr->checksum ^= *pmsg++;
}
info->DSPInfoBlk[8] = 0x7200; info->DSPInfoBlk[8] = 0x7200;
info->DSPInfoBlk[9] = info->DSPInfoBlk[9] =
htons(info->DSPInfoBlklen); htons(info->DSPInfoBlklen);
...@@ -1150,9 +1145,8 @@ static void ft1000_proc_drvmsg(struct net_device *dev) ...@@ -1150,9 +1145,8 @@ static void ft1000_proc_drvmsg(struct net_device *dev)
mdelay(10); mdelay(10);
tempword = tempword =
ft1000_read_reg(dev, FT1000_REG_DOORBELL); ft1000_read_reg(dev, FT1000_REG_DOORBELL);
if (tempword & FT1000_DB_DPRAM_TX) { if (tempword & FT1000_DB_DPRAM_TX)
mdelay(10); mdelay(10);
}
} }
if ((tempword & FT1000_DB_DPRAM_TX) == 0) { if ((tempword & FT1000_DB_DPRAM_TX) == 0) {
...@@ -1178,9 +1172,9 @@ static void ft1000_proc_drvmsg(struct net_device *dev) ...@@ -1178,9 +1172,9 @@ static void ft1000_proc_drvmsg(struct net_device *dev)
ppseudo_hdr->portsrc = 0; ppseudo_hdr->portsrc = 0;
/* Calculate new checksum */ /* Calculate new checksum */
ppseudo_hdr->checksum = *pmsg++; ppseudo_hdr->checksum = *pmsg++;
for (i = 1; i < 7; i++) { for (i = 1; i < 7; i++)
ppseudo_hdr->checksum ^= *pmsg++; ppseudo_hdr->checksum ^= *pmsg++;
}
pmsg = (u16 *)&tempbuffer[16]; pmsg = (u16 *)&tempbuffer[16];
*pmsg++ = htons(RSP_DRV_ERR_RPT_MSG); *pmsg++ = htons(RSP_DRV_ERR_RPT_MSG);
*pmsg++ = htons(0x000e); *pmsg++ = htons(0x000e);
...@@ -1502,9 +1496,8 @@ static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum) ...@@ -1502,9 +1496,8 @@ static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum)
tempword = inw(dev->base_addr + FT1000_REG_MAG_DFSR); tempword = inw(dev->base_addr + FT1000_REG_MAG_DFSR);
pr_debug("FT1000_REG_MAG_DFSR = 0x%x\n", tempword); pr_debug("FT1000_REG_MAG_DFSR = 0x%x\n", tempword);
} }
if (DrvErrNum) { if (DrvErrNum)
pcmcia->PktIntfErr++; pcmcia->PktIntfErr++;
}
} }
} }
...@@ -1561,9 +1554,9 @@ static int ft1000_copy_up_pkt(struct net_device *dev) ...@@ -1561,9 +1554,9 @@ static int ft1000_copy_up_pkt(struct net_device *dev)
if (skb == NULL) { if (skb == NULL) {
pr_debug("No Network buffers available\n"); pr_debug("No Network buffers available\n");
/* Read High word to complete 32 bit access */ /* Read High word to complete 32 bit access */
if (info->AsicID == MAGNEMITE_ID) { if (info->AsicID == MAGNEMITE_ID)
tempword = ft1000_read_reg(dev, FT1000_REG_MAG_DFRH); tempword = ft1000_read_reg(dev, FT1000_REG_MAG_DFRH);
}
ft1000_flush_fifo(dev, 0); ft1000_flush_fifo(dev, 0);
info->stats.rx_errors++; info->stats.rx_errors++;
return FAILURE; return FAILURE;
...@@ -1667,9 +1660,8 @@ static int ft1000_copy_up_pkt(struct net_device *dev) ...@@ -1667,9 +1660,8 @@ static int ft1000_copy_up_pkt(struct net_device *dev)
} }
pr_debug("Data passed to Protocol layer:\n"); pr_debug("Data passed to Protocol layer:\n");
for (i = 0; i < len + 12; i++) { for (i = 0; i < len + 12; i++)
pr_debug("Protocol Data: 0x%x\n", *ptemp++); pr_debug("Protocol Data: 0x%x\n", *ptemp++);
}
skb->dev = dev; skb->dev = dev;
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
...@@ -1723,21 +1715,16 @@ static int ft1000_copy_down_pkt(struct net_device *dev, u16 *packet, u16 len) ...@@ -1723,21 +1715,16 @@ static int ft1000_copy_down_pkt(struct net_device *dev, u16 *packet, u16 len)
/* Check if there is room on the FIFO */ /* Check if there is room on the FIFO */
if (len > ft1000_read_fifo_len(dev)) { if (len > ft1000_read_fifo_len(dev)) {
udelay(10); udelay(10);
if (len > ft1000_read_fifo_len(dev)) { if (len > ft1000_read_fifo_len(dev))
udelay(20); udelay(20);
} if (len > ft1000_read_fifo_len(dev))
if (len > ft1000_read_fifo_len(dev)) {
udelay(20); udelay(20);
} if (len > ft1000_read_fifo_len(dev))
if (len > ft1000_read_fifo_len(dev)) {
udelay(20); udelay(20);
} if (len > ft1000_read_fifo_len(dev))
if (len > ft1000_read_fifo_len(dev)) {
udelay(20); udelay(20);
} if (len > ft1000_read_fifo_len(dev))
if (len > ft1000_read_fifo_len(dev)) {
udelay(20); udelay(20);
}
if (len > ft1000_read_fifo_len(dev)) { if (len > ft1000_read_fifo_len(dev)) {
pr_debug("Transmit FIFO is full - pkt drop\n"); pr_debug("Transmit FIFO is full - pkt drop\n");
info->stats.tx_errors++; info->stats.tx_errors++;
...@@ -1745,11 +1732,11 @@ static int ft1000_copy_down_pkt(struct net_device *dev, u16 *packet, u16 len) ...@@ -1745,11 +1732,11 @@ static int ft1000_copy_down_pkt(struct net_device *dev, u16 *packet, u16 len)
} }
} }
/* Create pseudo header and send pseudo/ip to hardware */ /* Create pseudo header and send pseudo/ip to hardware */
if (info->AsicID == ELECTRABUZZ_ID) { if (info->AsicID == ELECTRABUZZ_ID)
pseudo.blk.length = len; pseudo.blk.length = len;
} else { else
pseudo.blk.length = ntohs(len); pseudo.blk.length = ntohs(len);
}
pseudo.blk.source = DSPID; /* Need to swap to get in correct order */ pseudo.blk.source = DSPID; /* Need to swap to get in correct order */
pseudo.blk.destination = HOSTID; pseudo.blk.destination = HOSTID;
pseudo.blk.portdest = NETWORKID; /* Need to swap to get in correct order */ pseudo.blk.portdest = NETWORKID; /* Need to swap to get in correct order */
...@@ -1762,9 +1749,8 @@ static int ft1000_copy_down_pkt(struct net_device *dev, u16 *packet, u16 len) ...@@ -1762,9 +1749,8 @@ static int ft1000_copy_down_pkt(struct net_device *dev, u16 *packet, u16 len)
pseudo.blk.qos_class = 0; pseudo.blk.qos_class = 0;
/* Calculate pseudo header checksum */ /* Calculate pseudo header checksum */
pseudo.blk.checksum = pseudo.buff[0]; pseudo.blk.checksum = pseudo.buff[0];
for (i = 1; i < 7; i++) { for (i = 1; i < 7; i++)
pseudo.blk.checksum ^= pseudo.buff[i]; pseudo.blk.checksum ^= pseudo.buff[i];
}
/* Production Mode */ /* Production Mode */
if (info->AsicID == ELECTRABUZZ_ID) { if (info->AsicID == ELECTRABUZZ_ID) {
...@@ -1829,9 +1815,8 @@ static int ft1000_copy_down_pkt(struct net_device *dev, u16 *packet, u16 len) ...@@ -1829,9 +1815,8 @@ static int ft1000_copy_down_pkt(struct net_device *dev, u16 *packet, u16 len)
plong = (u32 *)packet; plong = (u32 *)packet;
/* Write PPP type + IP Packet into Downlink FIFO */ /* Write PPP type + IP Packet into Downlink FIFO */
for (i = 0; i < (len >> 2); i++) { for (i = 0; i < (len >> 2); i++)
outl(*plong++, dev->base_addr + FT1000_REG_MAG_UFDR); outl(*plong++, dev->base_addr + FT1000_REG_MAG_UFDR);
}
/* Check for odd alignment */ /* Check for odd alignment */
if (len & 0x0003) { if (len & 0x0003) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment