Skip to content

Commit

Permalink
drivers/net: Remove unnecessary returns from void function()s
Browse files Browse the repository at this point in the history
This patch removes from drivers/net/ all the unnecessary
return; statements that precede the last closing brace of
void functions.

It does not remove the returns that are immediately
preceded by a label as gcc doesn't like that.

It also does not remove null void functions with return.

Done via:
$ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
  xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'

with some cleanups by hand.

Compile tested x86 allmodconfig only.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Joe Perches authored and David S. Miller committed May 14, 2010
1 parent 21ce849 commit a4b7709
Show file tree
Hide file tree
Showing 171 changed files with 0 additions and 631 deletions.
1 change: 0 additions & 1 deletion drivers/net/3c501.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,6 @@ static void el_receive(struct net_device *dev)
dev->stats.rx_packets++;
dev->stats.rx_bytes += pkt_len;
}
return;
}

/**
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/3c503.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,6 @@ el2_block_output(struct net_device *dev, int count,
}
blocked:;
outb_p(ei_status.interface_num==0 ? ECNTRL_THIN : ECNTRL_AUI, E33G_CNTRL);
return;
}

/* Read the 4 byte, page aligned 8390 specific header. */
Expand Down Expand Up @@ -689,7 +688,6 @@ el2_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring
}
blocked:;
outb_p(ei_status.interface_num == 0 ? ECNTRL_THIN : ECNTRL_AUI, E33G_CNTRL);
return;
}


Expand Down
1 change: 0 additions & 1 deletion drivers/net/3c507.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,6 @@ static void init_82586_mem(struct net_device *dev)
if (net_debug > 4)
pr_debug("%s: Initialized 82586, status %04x.\n", dev->name,
readw(shmem+iSCB_STATUS));
return;
}

static void hardware_send_packet(struct net_device *dev, void *buf, short length, short pad)
Expand Down
1 change: 0 additions & 1 deletion drivers/net/3c509.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,6 @@ static void update_stats(struct net_device *dev)
/* Back to window 1, and turn statistics back on. */
EL3WINDOW(1);
outw(StatsEnable, ioaddr + EL3_CMD);
return;
}

static int
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/3c515.c
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,6 @@ static void corkscrew_timer(unsigned long data)
dev->name, media_tbl[dev->if_port].name);

#endif /* AUTOMEDIA */
return;
}

static void corkscrew_timeout(struct net_device *dev)
Expand Down Expand Up @@ -1516,7 +1515,6 @@ static void update_stats(int ioaddr, struct net_device *dev)

/* We change back to window 7 (not 1) with the Vortex. */
EL3WINDOW(7);
return;
}

/* This new version of set_rx_mode() supports v1.4 kernels.
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/3c59x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,6 @@ vortex_timer(unsigned long data)
mod_timer(&vp->timer, RUN_AT(next_tick));
if (vp->deferred)
iowrite16(FakeIntr, ioaddr + EL3_CMD);
return;
}

static void vortex_tx_timeout(struct net_device *dev)
Expand Down Expand Up @@ -2798,7 +2797,6 @@ static void update_stats(void __iomem *ioaddr, struct net_device *dev)
}

EL3WINDOW(old_window >> 13);
return;
}

static int vortex_nway_reset(struct net_device *dev)
Expand Down Expand Up @@ -3120,7 +3118,6 @@ static void mdio_write(struct net_device *dev, int phy_id, int location, int val
iowrite16(MDIO_ENB_IN | MDIO_SHIFT_CLK, mdio_addr);
mdio_delay();
}
return;
}

/* ACPI: Advanced Configuration and Power Interface. */
Expand Down
1 change: 0 additions & 1 deletion drivers/net/7990.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,6 @@ static void lance_load_multicast (struct net_device *dev)
crc = crc >> 26;
mcast_table [crc >> 4] |= 1 << (crc & 0xf);
}
return;
}


Expand Down
2 changes: 0 additions & 2 deletions drivers/net/8139cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1224,8 +1224,6 @@ static void cp_tx_timeout(struct net_device *dev)
netif_wake_queue(dev);

spin_unlock_irqrestore(&cp->lock, flags);

return;
}

#ifdef BROKEN
Expand Down
1 change: 0 additions & 1 deletion drivers/net/a2065.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,6 @@ static void lance_load_multicast (struct net_device *dev)
crc = crc >> 26;
mcast_table [crc >> 4] |= 1 << (crc & 0xf);
}
return;
}

static void lance_set_multicast (struct net_device *dev)
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/ac3200.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,6 @@ static void ac_reset_8390(struct net_device *dev)
ei_status.txing = 0;
outb(AC_ENABLE, ioaddr + AC_RESET_PORT);
if (ei_debug > 1) printk("reset done\n");

return;
}

/* Grab the 8390 specific header. Similar to the block_input routine, but
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/acenic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2919,8 +2919,6 @@ static void __devinit ace_clear(struct ace_regs __iomem *regs, u32 dest, int siz
dest += tsize;
size -= tsize;
}

return;
}


Expand Down
1 change: 0 additions & 1 deletion drivers/net/apne.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,6 @@ apne_block_output(struct net_device *dev, int count,

outb(ENISR_RDC, nic_base + NE_EN0_ISR); /* Ack intr. */
ei_status.dmaing &= ~0x01;
return;
}

static irqreturn_t apne_interrupt(int irq, void *dev_id)
Expand Down
4 changes: 0 additions & 4 deletions drivers/net/appletalk/cops.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,8 +593,6 @@ static void cops_load (struct net_device *dev)
tangent_wait_reset(ioaddr);
inb(ioaddr); /* Clear initial ready signal. */
}

return;
}

/*
Expand Down Expand Up @@ -701,8 +699,6 @@ static void cops_poll(unsigned long ltdev)
/* poll 20 times per second */
cops_timer.expires = jiffies + HZ/20;
add_timer(&cops_timer);

return;
}

/*
Expand Down
1 change: 0 additions & 1 deletion drivers/net/appletalk/ltpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,6 @@ static void idle(struct net_device *dev)
inb_p(base+7);
inb_p(base+7);
}
return;
}


Expand Down
2 changes: 0 additions & 2 deletions drivers/net/at1700.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,6 @@ net_rx(struct net_device *dev)
printk("%s: Exint Rx packet with mode %02x after %d ticks.\n",
dev->name, inb(ioaddr + RX_MODE), i);
}
return;
}

/* The inverse routine to net_open(). */
Expand Down Expand Up @@ -869,7 +868,6 @@ set_rx_mode(struct net_device *dev)
outw(saved_bank, ioaddr + CONFIG_0);
}
spin_unlock_irqrestore (&lp->lock, flags);
return;
}

#ifdef MODULE
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/atl1c/atl1c_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,6 @@ static void atl1c_get_wol(struct net_device *netdev,
wol->wolopts |= WAKE_MAGIC;
if (adapter->wol & AT_WUFC_LNKC)
wol->wolopts |= WAKE_PHY;

return;
}

static int atl1c_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/atl1c/atl1c_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,6 @@ static void atl1c_common_task(struct work_struct *work)

if (adapter->work_event & ATL1C_WORK_EVENT_LINK_CHANGE)
atl1c_check_link_status(adapter);

return;
}


Expand Down
2 changes: 0 additions & 2 deletions drivers/net/atl1e/atl1e_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,6 @@ static void atl1e_get_wol(struct net_device *netdev,
wol->wolopts |= WAKE_MAGIC;
if (adapter->wol & AT_WUFC_LNKC)
wol->wolopts |= WAKE_PHY;

return;
}

static int atl1e_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
Expand Down
7 changes: 0 additions & 7 deletions drivers/net/atl1e/atl1e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,6 @@ static void atl1e_init_ring_resources(struct atl1e_adapter *adapter)
adapter->ring_vir_addr = NULL;
adapter->rx_ring.desc = NULL;
rwlock_init(&adapter->tx_ring.tx_lock);

return;
}

/*
Expand Down Expand Up @@ -905,8 +903,6 @@ static inline void atl1e_configure_des_ring(const struct atl1e_adapter *adapter)
AT_WRITE_REG(hw, REG_HOST_RXFPAGE_SIZE, rx_ring->page_size);
/* Load all of base address above */
AT_WRITE_REG(hw, REG_LOAD_PTR, 1);

return;
}

static inline void atl1e_configure_tx(struct atl1e_adapter *adapter)
Expand Down Expand Up @@ -950,7 +946,6 @@ static inline void atl1e_configure_tx(struct atl1e_adapter *adapter)
(((u16)hw->tpd_burst & TXQ_CTRL_NUM_TPD_BURST_MASK)
<< TXQ_CTRL_NUM_TPD_BURST_SHIFT)
| TXQ_CTRL_ENH_MODE | TXQ_CTRL_EN);
return;
}

static inline void atl1e_configure_rx(struct atl1e_adapter *adapter)
Expand Down Expand Up @@ -1004,7 +999,6 @@ static inline void atl1e_configure_rx(struct atl1e_adapter *adapter)
RXQ_CTRL_CUT_THRU_EN | RXQ_CTRL_EN;

AT_WRITE_REG(hw, REG_RXQ_CTRL, rxq_ctrl_data);
return;
}

static inline void atl1e_configure_dma(struct atl1e_adapter *adapter)
Expand All @@ -1024,7 +1018,6 @@ static inline void atl1e_configure_dma(struct atl1e_adapter *adapter)
<< DMA_CTRL_DMAW_DLY_CNT_SHIFT;

AT_WRITE_REG(hw, REG_DMA_CTRL, dma_ctrl_data);
return;
}

static void atl1e_setup_mac_ctrl(struct atl1e_adapter *adapter)
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/atlx/atl1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1830,8 +1830,6 @@ static void atl1_rx_checksum(struct atl1_adapter *adapter,
adapter->hw_csum_good++;
return;
}

return;
}

/*
Expand Down Expand Up @@ -3390,7 +3388,6 @@ static void atl1_get_wol(struct net_device *netdev,
wol->wolopts = 0;
if (adapter->wol & ATLX_WUFC_MAG)
wol->wolopts |= WAKE_MAGIC;
return;
}

static int atl1_set_wol(struct net_device *netdev,
Expand Down
1 change: 0 additions & 1 deletion drivers/net/atp.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,6 @@ static void net_rx(struct net_device *dev)
done:
write_reg(ioaddr, CMR1, CMR1_NextPkt);
lp->last_rx_time = jiffies;
return;
}

static void read_block(long ioaddr, int length, unsigned char *p, int data_mode)
Expand Down
1 change: 0 additions & 1 deletion drivers/net/ax88796.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ static void ax_block_output(struct net_device *dev, int count,

ei_outb(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
ei_status.dmaing &= ~0x01;
return;
}

/* definitions for accessing MII/EEPROM interface */
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/benet/be_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,6 @@ be_get_ethtool_stats(struct net_device *netdev,
data[i] = (et_stats[i].size == sizeof(u64)) ?
*(u64 *)p: *(u32 *)p;
}

return;
}

static void
Expand Down Expand Up @@ -466,7 +464,6 @@ be_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
else
wol->wolopts = 0;
memset(&wol->sopass, 0, sizeof(wol->sopass));
return;
}

static int
Expand Down
12 changes: 0 additions & 12 deletions drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,6 @@ static void skb_fill_rx_data(struct be_adapter *adapter,

done:
be_rx_stats_update(adapter, pktsize, num_rcvd);
return;
}

/* Process the RX completion indicated by rxcp when GRO is disabled */
Expand Down Expand Up @@ -884,8 +883,6 @@ static void be_rx_compl_process(struct be_adapter *adapter,
} else {
netif_receive_skb(skb);
}

return;
}

/* Process the RX completion indicated by rxcp when GRO is enabled */
Expand Down Expand Up @@ -965,7 +962,6 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter,
}

be_rx_stats_update(adapter, pkt_size, num_rcvd);
return;
}

static struct be_eth_rx_compl *be_rx_compl_get(struct be_adapter *adapter)
Expand Down Expand Up @@ -1059,8 +1055,6 @@ static void be_post_rx_frags(struct be_adapter *adapter)
/* Let be_worker replenish when memory is available */
adapter->rx_post_starved = true;
}

return;
}

static struct be_eth_tx_compl *be_tx_compl_get(struct be_queue_info *tx_cq)
Expand Down Expand Up @@ -1622,7 +1616,6 @@ static void be_msix_enable(struct be_adapter *adapter)
BE_NUM_MSIX_VECTORS);
if (status == 0)
adapter->msix_enabled = true;
return;
}

static void be_sriov_enable(struct be_adapter *adapter)
Expand All @@ -1634,7 +1627,6 @@ static void be_sriov_enable(struct be_adapter *adapter)
adapter->sriov_enabled = status ? false : true;
}
#endif
return;
}

static void be_sriov_disable(struct be_adapter *adapter)
Expand Down Expand Up @@ -1741,7 +1733,6 @@ static void be_irq_unregister(struct be_adapter *adapter)
be_free_irq(adapter, &adapter->rx_eq);
done:
adapter->isr_registered = false;
return;
}

static int be_open(struct net_device *netdev)
Expand Down Expand Up @@ -2620,8 +2611,6 @@ static void be_shutdown(struct pci_dev *pdev)
be_setup_wol(adapter, true);

pci_disable_device(pdev);

return;
}

static pci_ers_result_t be_eeh_err_detected(struct pci_dev *pdev,
Expand Down Expand Up @@ -2703,7 +2692,6 @@ static void be_eeh_resume(struct pci_dev *pdev)
return;
err:
dev_err(&adapter->pdev->dev, "EEH resume failed\n");
return;
}

static struct pci_error_handlers be_eeh_handlers = {
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/bfin_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,6 @@ static void bfin_mac_multicast_hash(struct net_device *dev)

bfin_write_EMAC_HASHHI(emac_hashhi);
bfin_write_EMAC_HASHLO(emac_hashlo);

return;
}

/*
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/bmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ static inline void
dbdma_st32(volatile __u32 __iomem *a, unsigned long x)
{
__asm__ volatile( "stwbrx %0,0,%1" : : "r" (x), "r" (a) : "memory");
return;
}

static inline unsigned long
Expand Down Expand Up @@ -382,8 +381,6 @@ bmac_init_registers(struct net_device *dev)
bmwrite(dev, RXCFG, RxCRCNoStrip | RxHashFilterEnable | RxRejectOwnPackets);

bmwrite(dev, INTDISABLE, EnableNormal);

return;
}

#if 0
Expand Down
Loading

0 comments on commit a4b7709

Please sign in to comment.