Commit aa5848bc authored by Radhey Shyam Pandey's avatar Radhey Shyam Pandey Committed by David S. Miller

net: emaclite: Simplify if-else statements

Remove else as it is not required with if doing a return.
It also coalesce the format onto a single line and add the
missing space after the comma. Fixes below checkpatch warning-

WARNING: else is not generally useful after a break or return
Signed-off-by: default avatarRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 21d61166
...@@ -564,19 +564,18 @@ static void xemaclite_tx_handler(struct net_device *dev) ...@@ -564,19 +564,18 @@ static void xemaclite_tx_handler(struct net_device *dev)
struct net_local *lp = netdev_priv(dev); struct net_local *lp = netdev_priv(dev);
dev->stats.tx_packets++; dev->stats.tx_packets++;
if (lp->deferred_skb) { if (!lp->deferred_skb)
if (xemaclite_send_data(lp, return;
(u8 *) lp->deferred_skb->data,
lp->deferred_skb->len) != 0) if (xemaclite_send_data(lp, (u8 *) lp->deferred_skb->data,
return; lp->deferred_skb->len))
else { return;
dev->stats.tx_bytes += lp->deferred_skb->len;
dev_kfree_skb_irq(lp->deferred_skb); dev->stats.tx_bytes += lp->deferred_skb->len;
lp->deferred_skb = NULL; dev_kfree_skb_irq(lp->deferred_skb);
netif_trans_update(dev); /* prevent tx timeout */ lp->deferred_skb = NULL;
netif_wake_queue(dev); netif_trans_update(dev); /* prevent tx timeout */
} netif_wake_queue(dev);
}
} }
/** /**
...@@ -1052,13 +1051,12 @@ static bool get_bool(struct platform_device *ofdev, const char *s) ...@@ -1052,13 +1051,12 @@ static bool get_bool(struct platform_device *ofdev, const char *s)
{ {
u32 *p = (u32 *)of_get_property(ofdev->dev.of_node, s, NULL); u32 *p = (u32 *)of_get_property(ofdev->dev.of_node, s, NULL);
if (p) { if (!p) {
return (bool)*p; dev_warn(&ofdev->dev, "Parameter %s not found, defaulting to false\n", s);
} else {
dev_warn(&ofdev->dev, "Parameter %s not found,"
"defaulting to false\n", s);
return false; return false;
} }
return (bool)*p;
} }
static const struct net_device_ops xemaclite_netdev_ops; static const struct net_device_ops xemaclite_netdev_ops;
......
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