Skip to content

Commit

Permalink
gianfar: Remove superfluous initialisations
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Ceuleers <jan.ceuleers@computer.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jan Ceuleers authored and David S. Miller committed Jun 5, 2012
1 parent bc4598b commit 3a2e16c
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions drivers/net/ethernet/freescale/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ static struct net_device_stats *gfar_get_stats(struct net_device *dev)
struct gfar_private *priv = netdev_priv(dev);
unsigned long rx_packets = 0, rx_bytes = 0, rx_dropped = 0;
unsigned long tx_packets = 0, tx_bytes = 0;
int i = 0;
int i;

for (i = 0; i < priv->num_rx_queues; i++) {
rx_packets += priv->rx_queue[i]->stats.rx_packets;
Expand Down Expand Up @@ -470,31 +470,31 @@ static const struct net_device_ops gfar_netdev_ops = {

void lock_rx_qs(struct gfar_private *priv)
{
int i = 0x0;
int i;

for (i = 0; i < priv->num_rx_queues; i++)
spin_lock(&priv->rx_queue[i]->rxlock);
}

void lock_tx_qs(struct gfar_private *priv)
{
int i = 0x0;
int i;

for (i = 0; i < priv->num_tx_queues; i++)
spin_lock(&priv->tx_queue[i]->txlock);
}

void unlock_rx_qs(struct gfar_private *priv)
{
int i = 0x0;
int i;

for (i = 0; i < priv->num_rx_queues; i++)
spin_unlock(&priv->rx_queue[i]->rxlock);
}

void unlock_tx_qs(struct gfar_private *priv)
{
int i = 0x0;
int i;

for (i = 0; i < priv->num_tx_queues; i++)
spin_unlock(&priv->tx_queue[i]->txlock);
Expand All @@ -516,23 +516,23 @@ static inline int gfar_uses_fcb(struct gfar_private *priv)

static void free_tx_pointers(struct gfar_private *priv)
{
int i = 0;
int i;

for (i = 0; i < priv->num_tx_queues; i++)
kfree(priv->tx_queue[i]);
}

static void free_rx_pointers(struct gfar_private *priv)
{
int i = 0;
int i;

for (i = 0; i < priv->num_rx_queues; i++)
kfree(priv->rx_queue[i]);
}

static void unmap_group_regs(struct gfar_private *priv)
{
int i = 0;
int i;

for (i = 0; i < MAXGROUPS; i++)
if (priv->gfargrp[i].regs)
Expand All @@ -541,15 +541,15 @@ static void unmap_group_regs(struct gfar_private *priv)

static void disable_napi(struct gfar_private *priv)
{
int i = 0;
int i;

for (i = 0; i < priv->num_grps; i++)
napi_disable(&priv->gfargrp[i].napi);
}

static void enable_napi(struct gfar_private *priv)
{
int i = 0;
int i;

for (i = 0; i < priv->num_grps; i++)
napi_enable(&priv->gfargrp[i].napi);
Expand Down Expand Up @@ -1514,7 +1514,7 @@ static void init_registers(struct net_device *dev)
{
struct gfar_private *priv = netdev_priv(dev);
struct gfar __iomem *regs = NULL;
int i = 0;
int i;

for (i = 0; i < priv->num_grps; i++) {
regs = priv->gfargrp[i].regs;
Expand Down Expand Up @@ -1589,7 +1589,7 @@ static void gfar_halt_nodisable(struct net_device *dev)
struct gfar_private *priv = netdev_priv(dev);
struct gfar __iomem *regs = NULL;
u32 tempval;
int i = 0;
int i;

for (i = 0; i < priv->num_grps; i++) {
regs = priv->gfargrp[i].regs;
Expand Down Expand Up @@ -1976,13 +1976,11 @@ static inline struct txfcb *gfar_add_fcb(struct sk_buff *skb)
static inline void gfar_tx_checksum(struct sk_buff *skb, struct txfcb *fcb,
int fcb_length)
{
u8 flags = 0;

/* If we're here, it's a IP packet with a TCP or UDP
* payload. We set it to checksum, using a pseudo-header
* we provide
*/
flags = TXFCB_DEFAULT;
u8 flags = TXFCB_DEFAULT;

/* Tell the controller what the protocol is
* And provide the already calculated phcs
Expand Down Expand Up @@ -2900,7 +2898,7 @@ static int gfar_poll(struct napi_struct *napi, int budget)
static void gfar_netpoll(struct net_device *dev)
{
struct gfar_private *priv = netdev_priv(dev);
int i = 0;
int i;

/* If the device has multiple interrupts, run tx/rx */
if (priv->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) {
Expand Down

0 comments on commit 3a2e16c

Please sign in to comment.