From patchwork Wed Sep 9 07:25:50 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Klauser X-Patchwork-Id: 33159 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 25E2FB7080 for ; Wed, 9 Sep 2009 17:26:00 +1000 (EST) Received: by ozlabs.org (Postfix) id 1ADFCDDD0C; Wed, 9 Sep 2009 17:26:00 +1000 (EST) 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 8643FDDD0B for ; Wed, 9 Sep 2009 17:25:59 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751787AbZIIHZu (ORCPT ); Wed, 9 Sep 2009 03:25:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751659AbZIIHZt (ORCPT ); Wed, 9 Sep 2009 03:25:49 -0400 Received: from mx2.zhaw.ch ([160.85.104.51]:63769 "EHLO mx2.zhaw.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751622AbZIIHZt (ORCPT ); Wed, 9 Sep 2009 03:25:49 -0400 Received: from mx2.zhaw.ch (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 9C3B92A3; Wed, 9 Sep 2009 09:25:50 +0200 (CEST) Received: from localhost.localdomain (staff-klto-0.zhaw.ch [160.85.232.164]) by mx2.zhaw.ch (Postfix) with ESMTP id 2AA6C298; Wed, 9 Sep 2009 09:25:50 +0200 (CEST) From: Tobias Klauser To: "David S. Miller" Cc: netdev@vger.kernel.org, Tobias Klauser Subject: [PATCH] niu: Use resource_size instead of private function Date: Wed, 9 Sep 2009 09:25:50 +0200 Message-Id: <1252481150-12166-1-git-send-email-tklauser@distanz.ch> X-Mailer: git-send-email 1.6.0.4 X-PMX-Version: 5.5.4.371499, Antispam-Engine: 2.7.1.369594, Antispam-Data: 2009.9.9.71525 X-PerlMx-Spam: Gauge=IIIIIIII, Probability=8%, Report=' BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __SANE_MSGID 0, __TO_MALFORMED_2 0' Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The function res_size in drivers/net/niu.c is a copy of resource_size in linux/ioport.h. Remove the function and use resource_size instead. Signed-off-by: Tobias Klauser --- drivers/net/niu.c | 23 +++++++++-------------- 1 files changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 119fd4e..76cc261 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c @@ -10145,11 +10145,6 @@ static const struct niu_ops niu_phys_ops = { .unmap_single = niu_phys_unmap_single, }; -static unsigned long res_size(struct resource *r) -{ - return r->end - r->start + 1UL; -} - static int __devinit niu_of_probe(struct of_device *op, const struct of_device_id *match) { @@ -10189,7 +10184,7 @@ static int __devinit niu_of_probe(struct of_device *op, dev->features |= (NETIF_F_SG | NETIF_F_HW_CSUM); np->regs = of_ioremap(&op->resource[1], 0, - res_size(&op->resource[1]), + resource_size(&op->resource[1]), "niu regs"); if (!np->regs) { dev_err(&op->dev, PFX "Cannot map device registers, " @@ -10199,7 +10194,7 @@ static int __devinit niu_of_probe(struct of_device *op, } np->vir_regs_1 = of_ioremap(&op->resource[2], 0, - res_size(&op->resource[2]), + resource_size(&op->resource[2]), "niu vregs-1"); if (!np->vir_regs_1) { dev_err(&op->dev, PFX "Cannot map device vir registers 1, " @@ -10209,7 +10204,7 @@ static int __devinit niu_of_probe(struct of_device *op, } np->vir_regs_2 = of_ioremap(&op->resource[3], 0, - res_size(&op->resource[3]), + resource_size(&op->resource[3]), "niu vregs-2"); if (!np->vir_regs_2) { dev_err(&op->dev, PFX "Cannot map device vir registers 2, " @@ -10244,19 +10239,19 @@ static int __devinit niu_of_probe(struct of_device *op, err_out_iounmap: if (np->vir_regs_1) { of_iounmap(&op->resource[2], np->vir_regs_1, - res_size(&op->resource[2])); + resource_size(&op->resource[2])); np->vir_regs_1 = NULL; } if (np->vir_regs_2) { of_iounmap(&op->resource[3], np->vir_regs_2, - res_size(&op->resource[3])); + resource_size(&op->resource[3])); np->vir_regs_2 = NULL; } if (np->regs) { of_iounmap(&op->resource[1], np->regs, - res_size(&op->resource[1])); + resource_size(&op->resource[1])); np->regs = NULL; } @@ -10281,19 +10276,19 @@ static int __devexit niu_of_remove(struct of_device *op) if (np->vir_regs_1) { of_iounmap(&op->resource[2], np->vir_regs_1, - res_size(&op->resource[2])); + resource_size(&op->resource[2])); np->vir_regs_1 = NULL; } if (np->vir_regs_2) { of_iounmap(&op->resource[3], np->vir_regs_2, - res_size(&op->resource[3])); + resource_size(&op->resource[3])); np->vir_regs_2 = NULL; } if (np->regs) { of_iounmap(&op->resource[1], np->regs, - res_size(&op->resource[1])); + resource_size(&op->resource[1])); np->regs = NULL; }