Commit aa50b552 authored by Moritz Fischer's avatar Moritz Fischer Committed by David S. Miller

net: macb: Fix coding style suggestions

This commit deals with a bunch of checkpatch suggestions
that without changing behavior make checkpatch happier.
Acked-by: default avatarMichal Simek <michal.simek@xilinx.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarMoritz Fischer <moritz.fischer@ettus.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 64ec42fe
...@@ -187,7 +187,7 @@ static void macb_get_hwaddr(struct macb *bp) ...@@ -187,7 +187,7 @@ static void macb_get_hwaddr(struct macb *bp)
pdata = dev_get_platdata(&bp->pdev->dev); pdata = dev_get_platdata(&bp->pdev->dev);
/* Check all 4 address register for vaild address */ /* Check all 4 address register for valid address */
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
bottom = macb_or_gem_readl(bp, SA1B + i * 8); bottom = macb_or_gem_readl(bp, SA1B + i * 8);
top = macb_or_gem_readl(bp, SA1T + i * 8); top = macb_or_gem_readl(bp, SA1T + i * 8);
...@@ -429,7 +429,7 @@ static int macb_mii_init(struct macb *bp) ...@@ -429,7 +429,7 @@ static int macb_mii_init(struct macb *bp)
macb_writel(bp, NCR, MACB_BIT(MPE)); macb_writel(bp, NCR, MACB_BIT(MPE));
bp->mii_bus = mdiobus_alloc(); bp->mii_bus = mdiobus_alloc();
if (bp->mii_bus == NULL) { if (!bp->mii_bus) {
err = -ENOMEM; err = -ENOMEM;
goto err_out; goto err_out;
} }
...@@ -728,10 +728,10 @@ static void gem_rx_refill(struct macb *bp) ...@@ -728,10 +728,10 @@ static void gem_rx_refill(struct macb *bp)
bp->rx_prepared_head++; bp->rx_prepared_head++;
if (bp->rx_skbuff[entry] == NULL) { if (!bp->rx_skbuff[entry]) {
/* allocate sk_buff for this free entry in ring */ /* allocate sk_buff for this free entry in ring */
skb = netdev_alloc_skb(bp->dev, bp->rx_buffer_size); skb = netdev_alloc_skb(bp->dev, bp->rx_buffer_size);
if (unlikely(skb == NULL)) { if (unlikely(!skb)) {
netdev_err(bp->dev, netdev_err(bp->dev,
"Unable to allocate sk_buff\n"); "Unable to allocate sk_buff\n");
break; break;
...@@ -922,7 +922,8 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag, ...@@ -922,7 +922,8 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag,
frag_len = len - offset; frag_len = len - offset;
} }
skb_copy_to_linear_data_offset(skb, offset, skb_copy_to_linear_data_offset(skb, offset,
macb_rx_buffer(bp, frag), frag_len); macb_rx_buffer(bp, frag),
frag_len);
offset += bp->rx_buffer_size; offset += bp->rx_buffer_size;
desc = macb_rx_desc(bp, frag); desc = macb_rx_desc(bp, frag);
desc->addr &= ~MACB_BIT(RX_USED); desc->addr &= ~MACB_BIT(RX_USED);
...@@ -1262,7 +1263,7 @@ static unsigned int macb_tx_map(struct macb *bp, ...@@ -1262,7 +1263,7 @@ static unsigned int macb_tx_map(struct macb *bp,
} }
/* Should never happen */ /* Should never happen */
if (unlikely(tx_skb == NULL)) { if (unlikely(!tx_skb)) {
netdev_err(bp->dev, "BUG! empty skb!\n"); netdev_err(bp->dev, "BUG! empty skb!\n");
return 0; return 0;
} }
...@@ -1341,7 +1342,7 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1341,7 +1342,7 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Count how many TX buffer descriptors are needed to send this /* Count how many TX buffer descriptors are needed to send this
* socket buffer: skb fragments of jumbo frames may need to be * socket buffer: skb fragments of jumbo frames may need to be
* splitted into many buffer descriptors. * split into many buffer descriptors.
*/ */
count = DIV_ROUND_UP(skb_headlen(skb), bp->max_tx_length); count = DIV_ROUND_UP(skb_headlen(skb), bp->max_tx_length);
nr_frags = skb_shinfo(skb)->nr_frags; nr_frags = skb_shinfo(skb)->nr_frags;
...@@ -1416,7 +1417,7 @@ static void gem_free_rx_buffers(struct macb *bp) ...@@ -1416,7 +1417,7 @@ static void gem_free_rx_buffers(struct macb *bp)
for (i = 0; i < RX_RING_SIZE; i++) { for (i = 0; i < RX_RING_SIZE; i++) {
skb = bp->rx_skbuff[i]; skb = bp->rx_skbuff[i];
if (skb == NULL) if (!skb)
continue; continue;
desc = &bp->rx_ring[i]; desc = &bp->rx_ring[i];
...@@ -1817,7 +1818,8 @@ static void macb_sethashtable(struct net_device *dev) ...@@ -1817,7 +1818,8 @@ static void macb_sethashtable(struct net_device *dev)
unsigned int bitnr; unsigned int bitnr;
struct macb *bp = netdev_priv(dev); struct macb *bp = netdev_priv(dev);
mc_filter[0] = mc_filter[1] = 0; mc_filter[0] = 0;
mc_filter[1] = 0;
netdev_for_each_mc_addr(ha, dev) { netdev_for_each_mc_addr(ha, dev) {
bitnr = hash_get_index(ha->addr); bitnr = hash_get_index(ha->addr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment