aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>2008-12-16 04:14:21 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-16 04:14:21 -0500
commitc40cf519f0c0f0cb0579d853949ef517a8bb494d (patch)
treee7bc198054f661ec0db0299535ba7a640f22750f /drivers
parent82ad33297410c1af8e993210da76e114a4c1670d (diff)
hp100: use roundup instead of open coding
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/hp100.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c
index 1f86240bc0f8..ebe7651fcb86 100644
--- a/drivers/net/hp100.c
+++ b/drivers/net/hp100.c
@@ -1212,7 +1212,7 @@ static int hp100_init_rxpdl(struct net_device *dev,
1212 *(pdlptr + 2) = (u_int) virt_to_whatever(dev, pdlptr); /* Address Frag 1 */ 1212 *(pdlptr + 2) = (u_int) virt_to_whatever(dev, pdlptr); /* Address Frag 1 */
1213 *(pdlptr + 3) = 4; /* Length Frag 1 */ 1213 *(pdlptr + 3) = 4; /* Length Frag 1 */
1214 1214
1215 return ((((MAX_RX_FRAG * 2 + 2) + 3) / 4) * 4); 1215 return roundup(MAX_RX_FRAG * 2 + 2, 4);
1216} 1216}
1217 1217
1218 1218
@@ -1227,7 +1227,7 @@ static int hp100_init_txpdl(struct net_device *dev,
1227 ringptr->pdl_paddr = virt_to_whatever(dev, pdlptr); /* +1 */ 1227 ringptr->pdl_paddr = virt_to_whatever(dev, pdlptr); /* +1 */
1228 ringptr->skb = (void *) NULL; 1228 ringptr->skb = (void *) NULL;
1229 1229
1230 return ((((MAX_TX_FRAG * 2 + 2) + 3) / 4) * 4); 1230 return roundup(MAX_TX_FRAG * 2 + 2, 4);
1231} 1231}
1232 1232
1233/* 1233/*
@@ -1256,7 +1256,7 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr,
1256 /* Note: This depends on the alloc_skb functions allocating more 1256 /* Note: This depends on the alloc_skb functions allocating more
1257 * space than requested, i.e. aligning to 16bytes */ 1257 * space than requested, i.e. aligning to 16bytes */
1258 1258
1259 ringptr->skb = dev_alloc_skb(((MAX_ETHER_SIZE + 2 + 3) / 4) * 4); 1259 ringptr->skb = dev_alloc_skb(roundup(MAX_ETHER_SIZE + 2, 4));
1260 1260
1261 if (NULL != ringptr->skb) { 1261 if (NULL != ringptr->skb) {
1262 /* 1262 /*
@@ -1279,7 +1279,7 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr,
1279#ifdef HP100_DEBUG_BM 1279#ifdef HP100_DEBUG_BM
1280 printk("hp100: %s: build_rx_pdl: PDH@0x%x, skb->data (len %d) at 0x%x\n", 1280 printk("hp100: %s: build_rx_pdl: PDH@0x%x, skb->data (len %d) at 0x%x\n",
1281 dev->name, (u_int) ringptr->pdl, 1281 dev->name, (u_int) ringptr->pdl,
1282 ((MAX_ETHER_SIZE + 2 + 3) / 4) * 4, 1282 roundup(MAX_ETHER_SIZE + 2, 4),
1283 (unsigned int) ringptr->skb->data); 1283 (unsigned int) ringptr->skb->data);
1284#endif 1284#endif
1285 1285