staging: et131x: Mainly whitespace changes to appease checkpatch

- Whitespace changes to appease checkpatch warnings
- Removed unneeded braces around single line if/else

Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Mark Einon 2011-10-23 10:22:53 +01:00 committed by Greg Kroah-Hartman
parent 8310c60238
commit 09a3fc2bf1
1 changed files with 46 additions and 35 deletions

View File

@ -2383,14 +2383,16 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
} }
#ifdef USE_FBR0 #ifdef USE_FBR0
adapter->rx_ring.psr_num_entries = adapter->rx_ring.fbr[1]->num_entries + adapter->rx_ring.psr_num_entries =
adapter->rx_ring.fbr[1]->num_entries +
adapter->rx_ring.fbr[0]->num_entries; adapter->rx_ring.fbr[0]->num_entries;
#else #else
adapter->rx_ring.psr_num_entries = adapter->rx_ring.fbr[0]->num_entries; adapter->rx_ring.psr_num_entries = adapter->rx_ring.fbr[0]->num_entries;
#endif #endif
/* Allocate an area of memory for Free Buffer Ring 1 */ /* Allocate an area of memory for Free Buffer Ring 1 */
bufsize = (sizeof(struct fbr_desc) * rx_ring->fbr[0]->num_entries) + 0xfff; bufsize = (sizeof(struct fbr_desc) * rx_ring->fbr[0]->num_entries) +
0xfff;
rx_ring->fbr[0]->ring_virtaddr = dma_alloc_coherent(&adapter->pdev->dev, rx_ring->fbr[0]->ring_virtaddr = dma_alloc_coherent(&adapter->pdev->dev,
bufsize, bufsize,
&rx_ring->fbr[0]->ring_physaddr, &rx_ring->fbr[0]->ring_physaddr,
@ -2421,7 +2423,8 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
#ifdef USE_FBR0 #ifdef USE_FBR0
/* Allocate an area of memory for Free Buffer Ring 0 */ /* Allocate an area of memory for Free Buffer Ring 0 */
bufsize = (sizeof(struct fbr_desc) * rx_ring->fbr[1]->num_entries) + 0xfff; bufsize = (sizeof(struct fbr_desc) * rx_ring->fbr[1]->num_entries) +
0xfff;
rx_ring->fbr[1]->ring_virtaddr = dma_alloc_coherent(&adapter->pdev->dev, rx_ring->fbr[1]->ring_virtaddr = dma_alloc_coherent(&adapter->pdev->dev,
bufsize, bufsize,
&rx_ring->fbr[1]->ring_physaddr, &rx_ring->fbr[1]->ring_physaddr,
@ -2471,7 +2474,8 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
(FBR_CHUNKS * rx_ring->fbr[0]->buffsize) + fbr1_align - 1; (FBR_CHUNKS * rx_ring->fbr[0]->buffsize) + fbr1_align - 1;
rx_ring->fbr[0]->mem_virtaddrs[i] = rx_ring->fbr[0]->mem_virtaddrs[i] =
dma_alloc_coherent(&adapter->pdev->dev, fbr_chunksize, dma_alloc_coherent(&adapter->pdev->dev, fbr_chunksize,
&rx_ring->fbr[0]->mem_physaddrs[i], GFP_KERNEL); &rx_ring->fbr[0]->mem_physaddrs[i],
GFP_KERNEL);
if (!rx_ring->fbr[0]->mem_virtaddrs[i]) { if (!rx_ring->fbr[0]->mem_virtaddrs[i]) {
dev_err(&adapter->pdev->dev, dev_err(&adapter->pdev->dev,
@ -2523,7 +2527,8 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
((FBR_CHUNKS + 1) * rx_ring->fbr[1]->buffsize) - 1; ((FBR_CHUNKS + 1) * rx_ring->fbr[1]->buffsize) - 1;
rx_ring->fbr[1]->mem_virtaddrs[i] = rx_ring->fbr[1]->mem_virtaddrs[i] =
dma_alloc_coherent(&adapter->pdev->dev, fbr_chunksize, dma_alloc_coherent(&adapter->pdev->dev, fbr_chunksize,
&rx_ring->fbr[1]->mem_physaddrs[i], GFP_KERNEL); &rx_ring->fbr[1]->mem_physaddrs[i],
GFP_KERNEL);
if (!rx_ring->fbr[1]->mem_virtaddrs[i]) { if (!rx_ring->fbr[1]->mem_virtaddrs[i]) {
dev_err(&adapter->pdev->dev, dev_err(&adapter->pdev->dev,
@ -2677,8 +2682,9 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
rx_ring->fbr[0]->ring_virtaddr = (void *)((u8 *) rx_ring->fbr[0]->ring_virtaddr = (void *)((u8 *)
rx_ring->fbr[0]->ring_virtaddr - rx_ring->fbr[0]->offset); rx_ring->fbr[0]->ring_virtaddr - rx_ring->fbr[0]->offset);
bufsize = (sizeof(struct fbr_desc) * rx_ring->fbr[0]->num_entries) bufsize =
+ 0xfff; (sizeof(struct fbr_desc) * rx_ring->fbr[0]->num_entries) +
0xfff;
dma_free_coherent(&adapter->pdev->dev, bufsize, dma_free_coherent(&adapter->pdev->dev, bufsize,
rx_ring->fbr[0]->ring_virtaddr, rx_ring->fbr[0]->ring_virtaddr,
@ -2711,8 +2717,9 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
rx_ring->fbr[1]->ring_virtaddr = (void *)((u8 *) rx_ring->fbr[1]->ring_virtaddr = (void *)((u8 *)
rx_ring->fbr[1]->ring_virtaddr - rx_ring->fbr[1]->offset); rx_ring->fbr[1]->ring_virtaddr - rx_ring->fbr[1]->offset);
bufsize = (sizeof(struct fbr_desc) * rx_ring->fbr[1]->num_entries) bufsize =
+ 0xfff; (sizeof(struct fbr_desc) * rx_ring->fbr[1]->num_entries) +
0xfff;
dma_free_coherent(&adapter->pdev->dev, dma_free_coherent(&adapter->pdev->dev,
bufsize, bufsize,
@ -2857,8 +2864,8 @@ static void nic_return_rfd(struct et131x_adapter *adapter, struct rfd *rfd)
spin_lock_irqsave(&adapter->fbr_lock, flags); spin_lock_irqsave(&adapter->fbr_lock, flags);
if (ring_index == 1) { if (ring_index == 1) {
struct fbr_desc *next = struct fbr_desc *next = (struct fbr_desc *)
(struct fbr_desc *) (rx_local->fbr[0]->ring_virtaddr) + (rx_local->fbr[0]->ring_virtaddr) +
INDEX10(rx_local->fbr[0]->local_full); INDEX10(rx_local->fbr[0]->local_full);
/* Handle the Free Buffer Ring advancement here. Write /* Handle the Free Buffer Ring advancement here. Write
@ -2869,7 +2876,8 @@ static void nic_return_rfd(struct et131x_adapter *adapter, struct rfd *rfd)
next->addr_lo = rx_local->fbr[0]->bus_low[buff_index]; next->addr_lo = rx_local->fbr[0]->bus_low[buff_index];
next->word2 = buff_index; next->word2 = buff_index;
writel(bump_free_buff_ring(&rx_local->fbr[0]->local_full, writel(bump_free_buff_ring(
&rx_local->fbr[0]->local_full,
rx_local->fbr[0]->num_entries - 1), rx_local->fbr[0]->num_entries - 1),
&rx_dma->fbr1_full_offset); &rx_dma->fbr1_full_offset);
} }
@ -3212,8 +3220,10 @@ int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter)
*/ */
desc_size = (sizeof(struct tx_desc) * NUM_DESC_PER_RING_TX) + 4096 - 1; desc_size = (sizeof(struct tx_desc) * NUM_DESC_PER_RING_TX) + 4096 - 1;
tx_ring->tx_desc_ring = tx_ring->tx_desc_ring =
(struct tx_desc *) dma_alloc_coherent(&adapter->pdev->dev, desc_size, (struct tx_desc *) dma_alloc_coherent(&adapter->pdev->dev,
&tx_ring->tx_desc_ring_pa, GFP_KERNEL); desc_size,
&tx_ring->tx_desc_ring_pa,
GFP_KERNEL);
if (!adapter->tx_ring.tx_desc_ring) { if (!adapter->tx_ring.tx_desc_ring) {
dev_err(&adapter->pdev->dev, dev_err(&adapter->pdev->dev,
"Cannot alloc memory for Tx Ring\n"); "Cannot alloc memory for Tx Ring\n");
@ -4871,7 +4881,8 @@ int et131x_close(struct net_device *netdev)
* *
* Returns 0 on success, errno on failure (as defined in errno.h) * Returns 0 on success, errno on failure (as defined in errno.h)
*/ */
static int et131x_ioctl(struct net_device *netdev, struct ifreq *reqbuf, int cmd) static int et131x_ioctl(struct net_device *netdev, struct ifreq *reqbuf,
int cmd)
{ {
struct et131x_adapter *adapter = netdev_priv(netdev); struct et131x_adapter *adapter = netdev_priv(netdev);
@ -5030,7 +5041,8 @@ static int et131x_tx(struct sk_buff *skb, struct net_device *netdev)
struct et131x_adapter *adapter = netdev_priv(netdev); struct et131x_adapter *adapter = netdev_priv(netdev);
/* stop the queue if it's getting full */ /* stop the queue if it's getting full */
if(adapter->tx_ring.used >= NUM_TCB - 1 && !netif_queue_stopped(netdev)) if (adapter->tx_ring.used >= NUM_TCB - 1 &&
!netif_queue_stopped(netdev))
netif_stop_queue(netdev); netif_stop_queue(netdev);
/* Save the timestamp for the TX timeout watchdog */ /* Save the timestamp for the TX timeout watchdog */
@ -5041,12 +5053,11 @@ static int et131x_tx(struct sk_buff *skb, struct net_device *netdev)
/* Check status and manage the netif queue if necessary */ /* Check status and manage the netif queue if necessary */
if (status != 0) { if (status != 0) {
if (status == -ENOMEM) { if (status == -ENOMEM)
status = NETDEV_TX_BUSY; status = NETDEV_TX_BUSY;
} else { else
status = NETDEV_TX_OK; status = NETDEV_TX_OK;
} }
}
return status; return status;
} }