diff options
author | Jan Ceuleers <jan.ceuleers@computer.org> | 2012-06-04 23:42:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-05 18:38:40 -0400 |
commit | 3a2e16c816017d952ed5f29ca9d6f5136ced5f21 (patch) | |
tree | dc6afe8a6fa549ccdd5db74f5e36b90dc8b95480 /drivers/net/ethernet/freescale | |
parent | bc4598bc076fcafa662c82b8ad3ace2d1b5fbdc1 (diff) |
gianfar: Remove superfluous initialisations
Signed-off-by: Jan Ceuleers <jan.ceuleers@computer.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index ed0b1369a5d9..f00a095f37b4 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c | |||
@@ -428,7 +428,7 @@ static struct net_device_stats *gfar_get_stats(struct net_device *dev) | |||
428 | struct gfar_private *priv = netdev_priv(dev); | 428 | struct gfar_private *priv = netdev_priv(dev); |
429 | unsigned long rx_packets = 0, rx_bytes = 0, rx_dropped = 0; | 429 | unsigned long rx_packets = 0, rx_bytes = 0, rx_dropped = 0; |
430 | unsigned long tx_packets = 0, tx_bytes = 0; | 430 | unsigned long tx_packets = 0, tx_bytes = 0; |
431 | int i = 0; | 431 | int i; |
432 | 432 | ||
433 | for (i = 0; i < priv->num_rx_queues; i++) { | 433 | for (i = 0; i < priv->num_rx_queues; i++) { |
434 | rx_packets += priv->rx_queue[i]->stats.rx_packets; | 434 | rx_packets += priv->rx_queue[i]->stats.rx_packets; |
@@ -470,7 +470,7 @@ static const struct net_device_ops gfar_netdev_ops = { | |||
470 | 470 | ||
471 | void lock_rx_qs(struct gfar_private *priv) | 471 | void lock_rx_qs(struct gfar_private *priv) |
472 | { | 472 | { |
473 | int i = 0x0; | 473 | int i; |
474 | 474 | ||
475 | for (i = 0; i < priv->num_rx_queues; i++) | 475 | for (i = 0; i < priv->num_rx_queues; i++) |
476 | spin_lock(&priv->rx_queue[i]->rxlock); | 476 | spin_lock(&priv->rx_queue[i]->rxlock); |
@@ -478,7 +478,7 @@ void lock_rx_qs(struct gfar_private *priv) | |||
478 | 478 | ||
479 | void lock_tx_qs(struct gfar_private *priv) | 479 | void lock_tx_qs(struct gfar_private *priv) |
480 | { | 480 | { |
481 | int i = 0x0; | 481 | int i; |
482 | 482 | ||
483 | for (i = 0; i < priv->num_tx_queues; i++) | 483 | for (i = 0; i < priv->num_tx_queues; i++) |
484 | spin_lock(&priv->tx_queue[i]->txlock); | 484 | spin_lock(&priv->tx_queue[i]->txlock); |
@@ -486,7 +486,7 @@ void lock_tx_qs(struct gfar_private *priv) | |||
486 | 486 | ||
487 | void unlock_rx_qs(struct gfar_private *priv) | 487 | void unlock_rx_qs(struct gfar_private *priv) |
488 | { | 488 | { |
489 | int i = 0x0; | 489 | int i; |
490 | 490 | ||
491 | for (i = 0; i < priv->num_rx_queues; i++) | 491 | for (i = 0; i < priv->num_rx_queues; i++) |
492 | spin_unlock(&priv->rx_queue[i]->rxlock); | 492 | spin_unlock(&priv->rx_queue[i]->rxlock); |
@@ -494,7 +494,7 @@ void unlock_rx_qs(struct gfar_private *priv) | |||
494 | 494 | ||
495 | void unlock_tx_qs(struct gfar_private *priv) | 495 | void unlock_tx_qs(struct gfar_private *priv) |
496 | { | 496 | { |
497 | int i = 0x0; | 497 | int i; |
498 | 498 | ||
499 | for (i = 0; i < priv->num_tx_queues; i++) | 499 | for (i = 0; i < priv->num_tx_queues; i++) |
500 | spin_unlock(&priv->tx_queue[i]->txlock); | 500 | spin_unlock(&priv->tx_queue[i]->txlock); |
@@ -516,7 +516,7 @@ static inline int gfar_uses_fcb(struct gfar_private *priv) | |||
516 | 516 | ||
517 | static void free_tx_pointers(struct gfar_private *priv) | 517 | static void free_tx_pointers(struct gfar_private *priv) |
518 | { | 518 | { |
519 | int i = 0; | 519 | int i; |
520 | 520 | ||
521 | for (i = 0; i < priv->num_tx_queues; i++) | 521 | for (i = 0; i < priv->num_tx_queues; i++) |
522 | kfree(priv->tx_queue[i]); | 522 | kfree(priv->tx_queue[i]); |
@@ -524,7 +524,7 @@ static void free_tx_pointers(struct gfar_private *priv) | |||
524 | 524 | ||
525 | static void free_rx_pointers(struct gfar_private *priv) | 525 | static void free_rx_pointers(struct gfar_private *priv) |
526 | { | 526 | { |
527 | int i = 0; | 527 | int i; |
528 | 528 | ||
529 | for (i = 0; i < priv->num_rx_queues; i++) | 529 | for (i = 0; i < priv->num_rx_queues; i++) |
530 | kfree(priv->rx_queue[i]); | 530 | kfree(priv->rx_queue[i]); |
@@ -532,7 +532,7 @@ static void free_rx_pointers(struct gfar_private *priv) | |||
532 | 532 | ||
533 | static void unmap_group_regs(struct gfar_private *priv) | 533 | static void unmap_group_regs(struct gfar_private *priv) |
534 | { | 534 | { |
535 | int i = 0; | 535 | int i; |
536 | 536 | ||
537 | for (i = 0; i < MAXGROUPS; i++) | 537 | for (i = 0; i < MAXGROUPS; i++) |
538 | if (priv->gfargrp[i].regs) | 538 | if (priv->gfargrp[i].regs) |
@@ -541,7 +541,7 @@ static void unmap_group_regs(struct gfar_private *priv) | |||
541 | 541 | ||
542 | static void disable_napi(struct gfar_private *priv) | 542 | static void disable_napi(struct gfar_private *priv) |
543 | { | 543 | { |
544 | int i = 0; | 544 | int i; |
545 | 545 | ||
546 | for (i = 0; i < priv->num_grps; i++) | 546 | for (i = 0; i < priv->num_grps; i++) |
547 | napi_disable(&priv->gfargrp[i].napi); | 547 | napi_disable(&priv->gfargrp[i].napi); |
@@ -549,7 +549,7 @@ static void disable_napi(struct gfar_private *priv) | |||
549 | 549 | ||
550 | static void enable_napi(struct gfar_private *priv) | 550 | static void enable_napi(struct gfar_private *priv) |
551 | { | 551 | { |
552 | int i = 0; | 552 | int i; |
553 | 553 | ||
554 | for (i = 0; i < priv->num_grps; i++) | 554 | for (i = 0; i < priv->num_grps; i++) |
555 | napi_enable(&priv->gfargrp[i].napi); | 555 | napi_enable(&priv->gfargrp[i].napi); |
@@ -1514,7 +1514,7 @@ static void init_registers(struct net_device *dev) | |||
1514 | { | 1514 | { |
1515 | struct gfar_private *priv = netdev_priv(dev); | 1515 | struct gfar_private *priv = netdev_priv(dev); |
1516 | struct gfar __iomem *regs = NULL; | 1516 | struct gfar __iomem *regs = NULL; |
1517 | int i = 0; | 1517 | int i; |
1518 | 1518 | ||
1519 | for (i = 0; i < priv->num_grps; i++) { | 1519 | for (i = 0; i < priv->num_grps; i++) { |
1520 | regs = priv->gfargrp[i].regs; | 1520 | regs = priv->gfargrp[i].regs; |
@@ -1589,7 +1589,7 @@ static void gfar_halt_nodisable(struct net_device *dev) | |||
1589 | struct gfar_private *priv = netdev_priv(dev); | 1589 | struct gfar_private *priv = netdev_priv(dev); |
1590 | struct gfar __iomem *regs = NULL; | 1590 | struct gfar __iomem *regs = NULL; |
1591 | u32 tempval; | 1591 | u32 tempval; |
1592 | int i = 0; | 1592 | int i; |
1593 | 1593 | ||
1594 | for (i = 0; i < priv->num_grps; i++) { | 1594 | for (i = 0; i < priv->num_grps; i++) { |
1595 | regs = priv->gfargrp[i].regs; | 1595 | regs = priv->gfargrp[i].regs; |
@@ -1976,13 +1976,11 @@ static inline struct txfcb *gfar_add_fcb(struct sk_buff *skb) | |||
1976 | static inline void gfar_tx_checksum(struct sk_buff *skb, struct txfcb *fcb, | 1976 | static inline void gfar_tx_checksum(struct sk_buff *skb, struct txfcb *fcb, |
1977 | int fcb_length) | 1977 | int fcb_length) |
1978 | { | 1978 | { |
1979 | u8 flags = 0; | ||
1980 | |||
1981 | /* If we're here, it's a IP packet with a TCP or UDP | 1979 | /* If we're here, it's a IP packet with a TCP or UDP |
1982 | * payload. We set it to checksum, using a pseudo-header | 1980 | * payload. We set it to checksum, using a pseudo-header |
1983 | * we provide | 1981 | * we provide |
1984 | */ | 1982 | */ |
1985 | flags = TXFCB_DEFAULT; | 1983 | u8 flags = TXFCB_DEFAULT; |
1986 | 1984 | ||
1987 | /* Tell the controller what the protocol is | 1985 | /* Tell the controller what the protocol is |
1988 | * And provide the already calculated phcs | 1986 | * And provide the already calculated phcs |
@@ -2900,7 +2898,7 @@ static int gfar_poll(struct napi_struct *napi, int budget) | |||
2900 | static void gfar_netpoll(struct net_device *dev) | 2898 | static void gfar_netpoll(struct net_device *dev) |
2901 | { | 2899 | { |
2902 | struct gfar_private *priv = netdev_priv(dev); | 2900 | struct gfar_private *priv = netdev_priv(dev); |
2903 | int i = 0; | 2901 | int i; |
2904 | 2902 | ||
2905 | /* If the device has multiple interrupts, run tx/rx */ | 2903 | /* If the device has multiple interrupts, run tx/rx */ |
2906 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) { | 2904 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) { |