--- a/devices/e1000/e1000_main-2.6.37-ethercat.c Tue Apr 10 19:09:51 2012 +0200
+++ b/devices/e1000/e1000_main-2.6.37-ethercat.c Tue Apr 10 19:10:56 2012 +0200
@@ -278,8 +278,9 @@
int irq_flags = IRQF_SHARED;
int err;
- if (adapter->ecdev)
+ if (adapter->ecdev) {
return 0;
+ }
err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name,
netdev);
@@ -294,8 +295,9 @@
{
struct net_device *netdev = adapter->netdev;
- if (adapter->ecdev)
+ if (adapter->ecdev) {
return;
+ }
free_irq(adapter->pdev->irq, netdev);
}
@@ -309,8 +311,9 @@
{
struct e1000_hw *hw = &adapter->hw;
- if (adapter->ecdev)
+ if (adapter->ecdev) {
return;
+ }
ew32(IMC, ~0);
E1000_WRITE_FLUSH();
@@ -326,8 +329,9 @@
{
struct e1000_hw *hw = &adapter->hw;
- if (adapter->ecdev)
+ if (adapter->ecdev) {
return;
+ }
ew32(IMS, IMS_ENABLE_MASK);
E1000_WRITE_FLUSH();
@@ -1933,8 +1937,9 @@
static void e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter,
struct e1000_buffer *buffer_info)
{
- if (adapter->ecdev)
+ if (adapter->ecdev) {
return;
+ }
if (buffer_info->dma) {
if (buffer_info->mapped_as_page)
@@ -2372,10 +2377,13 @@
adapter->tx_fifo_head = 0;
atomic_set(&adapter->tx_fifo_stall, 0);
- if (!adapter->ecdev) netif_wake_queue(netdev);
+ if (!adapter->ecdev) {
+ netif_wake_queue(netdev);
+ }
} else if (!test_bit(__E1000_DOWN, &adapter->flags)) {
- if (!adapter->ecdev)
+ if (!adapter->ecdev) {
mod_timer(&adapter->tx_fifo_stall_timer, jiffies + 1);
+ }
}
}
rtnl_unlock();
@@ -2435,7 +2443,7 @@
if ((adapter->ecdev && !ecdev_get_link(adapter->ecdev))
|| (!adapter->ecdev && !netif_carrier_ok(netdev))) {
u32 ctrl;
- bool txb2b = true;
+ bool txb2b __attribute__ ((unused)) = true;
/* update snapshot of PHY registers on LSC */
e1000_get_speed_and_duplex(hw,
&adapter->link_speed,
@@ -2550,7 +2558,9 @@
ew32(ICS, E1000_ICS_RXDMT0);
/* Force detection of hung controller every watchdog period */
- if (!adapter->ecdev) adapter->detect_tx_hung = true;
+ if (!adapter->ecdev) {
+ adapter->detect_tx_hung = true;
+ }
/* Reset the timer */
if (!adapter->ecdev) {
@@ -3110,8 +3120,9 @@
tx_ring = adapter->tx_ring;
if (unlikely(skb->len <= 0)) {
- if (!adapter->ecdev)
+ if (!adapter->ecdev) {
dev_kfree_skb_any(skb);
+ }
return NETDEV_TX_OK;
}
@@ -3238,7 +3249,9 @@
}
} else {
- if (!adapter->ecdev) dev_kfree_skb_any(skb);
+ if (!adapter->ecdev) {
+ dev_kfree_skb_any(skb);
+ }
tx_ring->buffer_info[first].time_stamp = 0;
tx_ring->next_to_use = first;
}
@@ -3296,8 +3309,9 @@
struct e1000_hw *hw = &adapter->hw;
int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
- if (adapter->ecdev)
+ if (adapter->ecdev) {
return -EBUSY;
+ }
if ((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) ||
(max_frame > MAX_JUMBO_FRAME_SIZE)) {
@@ -3385,8 +3399,9 @@
if (pci_channel_offline(pdev))
return;
- if (!adapter->ecdev)
+ if (!adapter->ecdev) {
spin_lock_irqsave(&adapter->stats_lock, flags);
+ }
/* these counters are modified from e1000_tbi_adjust_stats,
* called from the interrupt context, so they must only
@@ -3514,8 +3529,9 @@
adapter->stats.mgpdc += er32(MGTPDC);
}
- if (!adapter->ecdev)
+ if (!adapter->ecdev) {
spin_unlock_irqrestore(&adapter->stats_lock, flags);
+ }
}
void ec_poll(struct net_device *netdev)
@@ -3830,7 +3846,9 @@
status = rx_desc->status;
skb = buffer_info->skb;
- if (!adapter->ecdev) buffer_info->skb = NULL;
+ if (!adapter->ecdev) {
+ buffer_info->skb = NULL;
+ }
if (++i == rx_ring->count) i = 0;
next_rxd = E1000_RX_DESC(*rx_ring, i);
@@ -4047,7 +4065,9 @@
status = rx_desc->status;
skb = buffer_info->skb;
- if (!adapter->ecdev) buffer_info->skb = NULL;
+ if (!adapter->ecdev) {
+ buffer_info->skb = NULL;
+ }
prefetch(skb->data - NET_IP_ALIGN);
@@ -4485,7 +4505,9 @@
data->phy_id = hw->phy_addr;
break;
case SIOCGMIIREG:
- if (adapter->ecdev) return -EPERM;
+ if (adapter->ecdev) {
+ return -EPERM;
+ }
spin_lock_irqsave(&adapter->stats_lock, flags);
if (e1000_read_phy_reg(hw, data->reg_num & 0x1F,
&data->val_out)) {
@@ -4495,7 +4517,9 @@
spin_unlock_irqrestore(&adapter->stats_lock, flags);
break;
case SIOCSMIIREG:
- if (adapter->ecdev) return -EPERM;
+ if (adapter->ecdev) {
+ return -EPERM;
+ }
if (data->reg_num & ~(0x1F))
return -EFAULT;
mii_reg = data->val_in;
@@ -4736,8 +4760,9 @@
int retval = 0;
#endif
- if (adapter->ecdev)
+ if (adapter->ecdev) {
return -EBUSY;
+ }
netif_device_detach(netdev);
@@ -4836,8 +4861,9 @@
struct e1000_hw *hw = &adapter->hw;
u32 err;
- if (adapter->ecdev)
+ if (adapter->ecdev) {
return -EBUSY;
+ }
pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
@@ -4871,7 +4897,9 @@
if (netif_running(netdev))
e1000_up(adapter);
- if (!adapter->ecdev) netif_device_attach(netdev);
+ if (!adapter->ecdev) {
+ netif_device_attach(netdev);
+ }
return 0;
}