From patchwork Sat Dec 13 19:35:29 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 13856 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id C87C7DDFE3 for ; Sun, 14 Dec 2008 06:35:38 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751465AbYLMTfc (ORCPT ); Sat, 13 Dec 2008 14:35:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751452AbYLMTfc (ORCPT ); Sat, 13 Dec 2008 14:35:32 -0500 Received: from courier.cs.helsinki.fi ([128.214.9.1]:33838 "EHLO mail.cs.helsinki.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751277AbYLMTfb (ORCPT ); Sat, 13 Dec 2008 14:35:31 -0500 Received: from wrl-59.cs.helsinki.fi (wrl-59.cs.helsinki.fi [128.214.166.179]) (AUTH: PLAIN cs-relay, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by mail.cs.helsinki.fi with esmtp; Sat, 13 Dec 2008 21:35:29 +0200 id 0008C251.49440E81.0000731C Received: by wrl-59.cs.helsinki.fi (Postfix, from userid 50795) id 84166A0096; Sat, 13 Dec 2008 21:35:29 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by wrl-59.cs.helsinki.fi (Postfix) with ESMTP id 812FFA0091; Sat, 13 Dec 2008 21:35:29 +0200 (EET) Date: Sat, 13 Dec 2008 21:35:29 +0200 (EET) From: "=?ISO-8859-1?Q?Ilpo_J=E4rvinen?=" X-X-Sender: ijjarvin@wrl-59.cs.helsinki.fi To: David Miller cc: Netdev , Jeff Garzik Subject: [PATCH] hp100: use roundup instead of open coding Message-ID: MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Signed-off-by: Ilpo Järvinen --- drivers/net/hp100.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index 1f86240..ebe7651 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c @@ -1212,7 +1212,7 @@ static int hp100_init_rxpdl(struct net_device *dev, *(pdlptr + 2) = (u_int) virt_to_whatever(dev, pdlptr); /* Address Frag 1 */ *(pdlptr + 3) = 4; /* Length Frag 1 */ - return ((((MAX_RX_FRAG * 2 + 2) + 3) / 4) * 4); + return roundup(MAX_RX_FRAG * 2 + 2, 4); } @@ -1227,7 +1227,7 @@ static int hp100_init_txpdl(struct net_device *dev, ringptr->pdl_paddr = virt_to_whatever(dev, pdlptr); /* +1 */ ringptr->skb = (void *) NULL; - return ((((MAX_TX_FRAG * 2 + 2) + 3) / 4) * 4); + return roundup(MAX_TX_FRAG * 2 + 2, 4); } /* @@ -1256,7 +1256,7 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr, /* Note: This depends on the alloc_skb functions allocating more * space than requested, i.e. aligning to 16bytes */ - ringptr->skb = dev_alloc_skb(((MAX_ETHER_SIZE + 2 + 3) / 4) * 4); + ringptr->skb = dev_alloc_skb(roundup(MAX_ETHER_SIZE + 2, 4)); if (NULL != ringptr->skb) { /* @@ -1279,7 +1279,7 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr, #ifdef HP100_DEBUG_BM printk("hp100: %s: build_rx_pdl: PDH@0x%x, skb->data (len %d) at 0x%x\n", dev->name, (u_int) ringptr->pdl, - ((MAX_ETHER_SIZE + 2 + 3) / 4) * 4, + roundup(MAX_ETHER_SIZE + 2, 4), (unsigned int) ringptr->skb->data); #endif