Skip to content

Commit 807540b

Browse files
Eric Dumazetdavem330
authored andcommitted
drivers/net: return operator cleanup
Change "return (EXPR);" to "return EXPR;" return is not a function, parentheses are not required. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent cb4dfe5 commit 807540b

106 files changed

Lines changed: 762 additions & 764 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎drivers/net/3c523.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ static int __init do_elmc_probe(struct net_device *dev)
463463

464464
/* we didn't find any 3c523 in the slots we checked for */
465465
if (slot == MCA_NOTFOUND)
466-
return ((base_addr || irq) ? -ENXIO : -ENODEV);
466+
return (base_addr || irq) ? -ENXIO : -ENODEV;
467467

468468
mca_set_adapter_name(slot, "3Com 3c523 Etherlink/MC");
469469
mca_set_adapter_procfn(slot, (MCA_ProcFn) elmc_getinfo, dev);

‎drivers/net/appletalk/ipddp.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ static int ipddp_delete(struct ipddp_route *rt)
244244
}
245245

246246
spin_unlock_bh(&ipddp_route_lock);
247-
return (-ENOENT);
247+
return -ENOENT;
248248
}
249249

250250
/*
@@ -259,10 +259,10 @@ static struct ipddp_route* __ipddp_find_route(struct ipddp_route *rt)
259259
if(f->ip == rt->ip &&
260260
f->at.s_net == rt->at.s_net &&
261261
f->at.s_node == rt->at.s_node)
262-
return (f);
262+
return f;
263263
}
264264

265-
return (NULL);
265+
return NULL;
266266
}
267267

268268
static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
@@ -279,7 +279,7 @@ static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
279279
switch(cmd)
280280
{
281281
case SIOCADDIPDDPRT:
282-
return (ipddp_create(&rcp));
282+
return ipddp_create(&rcp);
283283

284284
case SIOCFINDIPDDPRT:
285285
spin_lock_bh(&ipddp_route_lock);
@@ -297,7 +297,7 @@ static int ipddp_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
297297
return -ENOENT;
298298

299299
case SIOCDELIPDDPRT:
300-
return (ipddp_delete(&rcp));
300+
return ipddp_delete(&rcp);
301301

302302
default:
303303
return -EINVAL;

‎drivers/net/appletalk/ltpc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ static int sendup_buffer (struct net_device *dev)
727727

728728
if (ltc->command != LT_RCVLAP) {
729729
printk("unknown command 0x%02x from ltpc card\n",ltc->command);
730-
return(-1);
730+
return -1;
731731
}
732732
dnode = ltc->dnode;
733733
snode = ltc->snode;

‎drivers/net/atarilance.c‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ static void *slow_memcpy( void *dst, const void *src, size_t len )
362362
*cto++ = *cfrom++;
363363
MFPDELAY();
364364
}
365-
return( dst );
365+
return dst;
366366
}
367367

368368

@@ -449,7 +449,7 @@ static noinline int __init addr_accessible(volatile void *regp, int wordflag,
449449
vbr[2] = save_berr;
450450
local_irq_restore(flags);
451451

452-
return( ret );
452+
return ret;
453453
}
454454

455455
static const struct net_device_ops lance_netdev_ops = {
@@ -526,7 +526,7 @@ static unsigned long __init lance_probe1( struct net_device *dev,
526526
goto probe_ok;
527527

528528
probe_fail:
529-
return( 0 );
529+
return 0;
530530

531531
probe_ok:
532532
lp = netdev_priv(dev);
@@ -556,7 +556,7 @@ static unsigned long __init lance_probe1( struct net_device *dev,
556556
if (request_irq(IRQ_AUTO_5, lance_interrupt, IRQ_TYPE_PRIO,
557557
"PAM/Riebl-ST Ethernet", dev)) {
558558
printk( "Lance: request for irq %d failed\n", IRQ_AUTO_5 );
559-
return( 0 );
559+
return 0;
560560
}
561561
dev->irq = (unsigned short)IRQ_AUTO_5;
562562
}
@@ -568,12 +568,12 @@ static unsigned long __init lance_probe1( struct net_device *dev,
568568
unsigned long irq = atari_register_vme_int();
569569
if (!irq) {
570570
printk( "Lance: request for VME interrupt failed\n" );
571-
return( 0 );
571+
return 0;
572572
}
573573
if (request_irq(irq, lance_interrupt, IRQ_TYPE_PRIO,
574574
"Riebl-VME Ethernet", dev)) {
575575
printk( "Lance: request for irq %ld failed\n", irq );
576-
return( 0 );
576+
return 0;
577577
}
578578
dev->irq = irq;
579579
}
@@ -637,7 +637,7 @@ static unsigned long __init lance_probe1( struct net_device *dev,
637637
/* XXX MSch */
638638
dev->watchdog_timeo = TX_TIMEOUT;
639639

640-
return( 1 );
640+
return 1;
641641
}
642642

643643

@@ -666,7 +666,7 @@ static int lance_open( struct net_device *dev )
666666
DPRINTK( 2, ( "lance_open(): opening %s failed, i=%d, csr0=%04x\n",
667667
dev->name, i, DREG ));
668668
DREG = CSR0_STOP;
669-
return( -EIO );
669+
return -EIO;
670670
}
671671
DREG = CSR0_IDON;
672672
DREG = CSR0_STRT;
@@ -676,7 +676,7 @@ static int lance_open( struct net_device *dev )
676676

677677
DPRINTK( 2, ( "%s: LANCE is open, csr0 %04x\n", dev->name, DREG ));
678678

679-
return( 0 );
679+
return 0;
680680
}
681681

682682

@@ -1126,13 +1126,13 @@ static int lance_set_mac_address( struct net_device *dev, void *addr )
11261126
int i;
11271127

11281128
if (lp->cardtype != OLD_RIEBL && lp->cardtype != NEW_RIEBL)
1129-
return( -EOPNOTSUPP );
1129+
return -EOPNOTSUPP;
11301130

11311131
if (netif_running(dev)) {
11321132
/* Only possible while card isn't started */
11331133
DPRINTK( 1, ( "%s: hwaddr can be set only while card isn't open.\n",
11341134
dev->name ));
1135-
return( -EIO );
1135+
return -EIO;
11361136
}
11371137

11381138
memcpy( dev->dev_addr, saddr->sa_data, dev->addr_len );
@@ -1142,7 +1142,7 @@ static int lance_set_mac_address( struct net_device *dev, void *addr )
11421142
/* set also the magic for future sessions */
11431143
*RIEBL_MAGIC_ADDR = RIEBL_MAGIC;
11441144

1145-
return( 0 );
1145+
return 0;
11461146
}
11471147

11481148

‎drivers/net/atlx/atl1.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2094,9 +2094,9 @@ static u16 atl1_tpd_avail(struct atl1_tpd_ring *tpd_ring)
20942094
{
20952095
u16 next_to_clean = atomic_read(&tpd_ring->next_to_clean);
20962096
u16 next_to_use = atomic_read(&tpd_ring->next_to_use);
2097-
return ((next_to_clean > next_to_use) ?
2097+
return (next_to_clean > next_to_use) ?
20982098
next_to_clean - next_to_use - 1 :
2099-
tpd_ring->count + next_to_clean - next_to_use - 1);
2099+
tpd_ring->count + next_to_clean - next_to_use - 1;
21002100
}
21012101

21022102
static int atl1_tso(struct atl1_adapter *adapter, struct sk_buff *skb,

‎drivers/net/benet/be_cmds.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ static void be_async_link_state_process(struct be_adapter *adapter,
9898

9999
static inline bool is_link_state_evt(u32 trailer)
100100
{
101-
return (((trailer >> ASYNC_TRAILER_EVENT_CODE_SHIFT) &
101+
return ((trailer >> ASYNC_TRAILER_EVENT_CODE_SHIFT) &
102102
ASYNC_TRAILER_EVENT_CODE_MASK) ==
103-
ASYNC_EVENT_CODE_LINK_STATE);
103+
ASYNC_EVENT_CODE_LINK_STATE;
104104
}
105105

106106
static struct be_mcc_compl *be_mcc_compl_get(struct be_adapter *adapter)

‎drivers/net/bmac.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1581,7 +1581,7 @@ bmac_proc_info(char *buffer, char **start, off_t offset, int length)
15811581
int i;
15821582

15831583
if (bmac_devs == NULL)
1584-
return (-ENOSYS);
1584+
return -ENOSYS;
15851585

15861586
len += sprintf(buffer, "BMAC counters & registers\n");
15871587

‎drivers/net/bna/bna_ctrl.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
static int
2626
bna_is_aen(u8 msg_id)
2727
{
28-
return (msg_id == BFI_LL_I2H_LINK_DOWN_AEN ||
29-
msg_id == BFI_LL_I2H_LINK_UP_AEN);
28+
return msg_id == BFI_LL_I2H_LINK_DOWN_AEN ||
29+
msg_id == BFI_LL_I2H_LINK_UP_AEN;
3030
}
3131

3232
static void
@@ -1702,7 +1702,7 @@ bna_device_cb_port_stopped(void *arg, enum bna_cb_status status)
17021702
int
17031703
bna_device_status_get(struct bna_device *device)
17041704
{
1705-
return (device->fsm == (bfa_fsm_t)bna_device_sm_ready);
1705+
return device->fsm == (bfa_fsm_t)bna_device_sm_ready;
17061706
}
17071707

17081708
void

‎drivers/net/bnx2.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ static inline u32 bnx2_tx_avail(struct bnx2 *bp, struct bnx2_tx_ring_info *txr)
266266
if (diff == TX_DESC_CNT)
267267
diff = MAX_TX_DESC_CNT;
268268
}
269-
return (bp->tx_ring_size - diff);
269+
return bp->tx_ring_size - diff;
270270
}
271271

272272
static u32
@@ -299,7 +299,7 @@ bnx2_shmem_wr(struct bnx2 *bp, u32 offset, u32 val)
299299
static u32
300300
bnx2_shmem_rd(struct bnx2 *bp, u32 offset)
301301
{
302-
return (bnx2_reg_rd_ind(bp, bp->shmem_base + offset));
302+
return bnx2_reg_rd_ind(bp, bp->shmem_base + offset);
303303
}
304304

305305
static void
@@ -977,9 +977,9 @@ bnx2_report_fw_link(struct bnx2 *bp)
977977
static char *
978978
bnx2_xceiver_str(struct bnx2 *bp)
979979
{
980-
return ((bp->phy_port == PORT_FIBRE) ? "SerDes" :
980+
return (bp->phy_port == PORT_FIBRE) ? "SerDes" :
981981
((bp->phy_flags & BNX2_PHY_FLAG_SERDES) ? "Remote Copper" :
982-
"Copper"));
982+
"Copper");
983983
}
984984

985985
static void
@@ -1758,7 +1758,7 @@ __acquires(&bp->phy_lock)
17581758
u32 new_adv = 0;
17591759

17601760
if (bp->phy_flags & BNX2_PHY_FLAG_REMOTE_PHY_CAP)
1761-
return (bnx2_setup_remote_phy(bp, port));
1761+
return bnx2_setup_remote_phy(bp, port);
17621762

17631763
if (!(bp->autoneg & AUTONEG_SPEED)) {
17641764
u32 new_bmcr;
@@ -2171,10 +2171,10 @@ __acquires(&bp->phy_lock)
21712171
return 0;
21722172

21732173
if (bp->phy_flags & BNX2_PHY_FLAG_SERDES) {
2174-
return (bnx2_setup_serdes_phy(bp, port));
2174+
return bnx2_setup_serdes_phy(bp, port);
21752175
}
21762176
else {
2177-
return (bnx2_setup_copper_phy(bp));
2177+
return bnx2_setup_copper_phy(bp);
21782178
}
21792179
}
21802180

@@ -7582,9 +7582,9 @@ bnx2_set_tx_csum(struct net_device *dev, u32 data)
75827582
struct bnx2 *bp = netdev_priv(dev);
75837583

75847584
if (CHIP_NUM(bp) == CHIP_NUM_5709)
7585-
return (ethtool_op_set_tx_ipv6_csum(dev, data));
7585+
return ethtool_op_set_tx_ipv6_csum(dev, data);
75867586
else
7587-
return (ethtool_op_set_tx_csum(dev, data));
7587+
return ethtool_op_set_tx_csum(dev, data);
75887588
}
75897589

75907590
static int
@@ -7705,7 +7705,7 @@ bnx2_change_mtu(struct net_device *dev, int new_mtu)
77057705
return -EINVAL;
77067706

77077707
dev->mtu = new_mtu;
7708-
return (bnx2_change_ring_size(bp, bp->rx_ring_size, bp->tx_ring_size));
7708+
return bnx2_change_ring_size(bp, bp->rx_ring_size, bp->tx_ring_size);
77097709
}
77107710

77117711
#ifdef CONFIG_NET_POLL_CONTROLLER

‎drivers/net/bnx2x/bnx2x_cmn.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ static inline int bnx2x_has_tx_work_unload(struct bnx2x_fastpath *fp)
399399
{
400400
/* Tell compiler that consumer and producer can change */
401401
barrier();
402-
return (fp->tx_pkt_prod != fp->tx_pkt_cons);
402+
return fp->tx_pkt_prod != fp->tx_pkt_cons;
403403
}
404404

405405
static inline u16 bnx2x_tx_avail(struct bnx2x_fastpath *fp)
@@ -632,7 +632,7 @@ static inline int bnx2x_has_rx_work(struct bnx2x_fastpath *fp)
632632
rx_cons_sb = le16_to_cpu(*fp->rx_cons_sb);
633633
if ((rx_cons_sb & MAX_RCQ_DESC_CNT) == MAX_RCQ_DESC_CNT)
634634
rx_cons_sb++;
635-
return (fp->rx_comp_cons != rx_cons_sb);
635+
return fp->rx_comp_cons != rx_cons_sb;
636636
}
637637

638638
/* HW Lock for shared dual port PHYs */

0 commit comments

Comments
 (0)