Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933007AbZLNVOO (ORCPT ); Mon, 14 Dec 2009 16:14:14 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932656AbZLNVOO (ORCPT ); Mon, 14 Dec 2009 16:14:14 -0500 Received: from exprod6og116.obsmtp.com ([64.18.1.37]:45430 "EHLO exprod6og116.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932644AbZLNVON convert rfc822-to-8bit (ORCPT ); Mon, 14 Dec 2009 16:14:13 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: [PATCH] davinci_nand.c: use resource_size() Date: Mon, 14 Dec 2009 16:13:13 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] davinci_nand.c: use resource_size() Thread-Index: Acp9Aj7lSLM6zpGoSka1wxYuzEn5RA== From: "H Hartley Sweeten" To: "kernel list" , Cc: "David Woodhouse" X-OriginalArrivalTime: 14 Dec 2009 21:13:11.0983 (UTC) FILETIME=[3E2A0BF0:01CA7D02] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1035 Lines: 27 The ioremap'ed sizes are off by 1, use resource_size() for correct value. Signed-off-by: H Hartley Sweeten Cc: David Woodhouse --- diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c index f13f5b9..b6905f8 100644 --- a/drivers/mtd/nand/davinci_nand.c +++ b/drivers/mtd/nand/davinci_nand.c @@ -566,8 +566,8 @@ static int __init nand_davinci_probe(struct platform_device *pdev) goto err_nomem; } - vaddr = ioremap(res1->start, res1->end - res1->start); - base = ioremap(res2->start, res2->end - res2->start); + vaddr = ioremap(res1->start, resource_size(res1)); + base = ioremap(res2->start, resource_size(res2)); if (!vaddr || !base) { dev_err(&pdev->dev, "ioremap failed\n"); ret = -EINVAL; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/