aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2015-07-24 14:24:03 -0400
committerDavid S. Miller <davem@davemloft.net>2015-07-27 04:10:29 -0400
commit94b295edc2c678212376a8aca9308cf6ee430b89 (patch)
tree450dfc85c4e3b495301e36a070107d24153a9eee
parent8bcbf82f31a94f8e4f939ac57478d808263c3890 (diff)
net/macb: replace macb_count_tx_descriptors() by DIV_ROUND_UP()
macb_count_tx_descriptors() repeats the generic macro DIV_ROUND_UP(). The patch does a replacement. There is no functional change. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/cadence/macb.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 77a5270ccae5..c638757251e6 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1157,12 +1157,6 @@ static void macb_poll_controller(struct net_device *dev)
1157} 1157}
1158#endif 1158#endif
1159 1159
1160static inline unsigned int macb_count_tx_descriptors(struct macb *bp,
1161 unsigned int len)
1162{
1163 return (len + bp->max_tx_length - 1) / bp->max_tx_length;
1164}
1165
1166static unsigned int macb_tx_map(struct macb *bp, 1160static unsigned int macb_tx_map(struct macb *bp,
1167 struct macb_queue *queue, 1161 struct macb_queue *queue,
1168 struct sk_buff *skb) 1162 struct sk_buff *skb)
@@ -1313,11 +1307,11 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
1313 * socket buffer: skb fragments of jumbo frames may need to be 1307 * socket buffer: skb fragments of jumbo frames may need to be
1314 * splitted into many buffer descriptors. 1308 * splitted into many buffer descriptors.
1315 */ 1309 */
1316 count = macb_count_tx_descriptors(bp, skb_headlen(skb)); 1310 count = DIV_ROUND_UP(skb_headlen(skb), bp->max_tx_length);
1317 nr_frags = skb_shinfo(skb)->nr_frags; 1311 nr_frags = skb_shinfo(skb)->nr_frags;
1318 for (f = 0; f < nr_frags; f++) { 1312 for (f = 0; f < nr_frags; f++) {
1319 frag_size = skb_frag_size(&skb_shinfo(skb)->frags[f]); 1313 frag_size = skb_frag_size(&skb_shinfo(skb)->frags[f]);
1320 count += macb_count_tx_descriptors(bp, frag_size); 1314 count += DIV_ROUND_UP(frag_size, bp->max_tx_length);
1321 } 1315 }
1322 1316
1323 spin_lock_irqsave(&bp->lock, flags); 1317 spin_lock_irqsave(&bp->lock, flags);