From patchwork Sat Jun 5 06:48:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wan ZongShun X-Patchwork-Id: 54739 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4E2DEB7D1D for ; Sat, 5 Jun 2010 16:50:48 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1OKnC4-00079T-LA; Sat, 05 Jun 2010 06:49:20 +0000 Received: from mail-pw0-f49.google.com ([209.85.160.49]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1OKnC2-00078c-0e; Sat, 05 Jun 2010 06:49:18 +0000 Received: by pwi2 with SMTP id 2so977389pwi.36 for ; Fri, 04 Jun 2010 23:49:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=VDZ601PSMIuS+qVb3VvtazfZcdaXIFJJyHM12C70f8g=; b=Ei0hzpdUe4z+GpVAlKQmHlC9CMlh9812NCPnRH0I9elv4I03X/DIxF6cqF3o8y2UOD a4g72kJ9VG1YPir/RRgbCwhTTOgzpKEJ2ceu9HkLdA5LwNbgD2zakLzjAoxUQyHxknQ7 YQkrubvrahFhPD7JJT88J5Z7FnzXYuTficyfA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=AlDKpQKkN2cnVEDmfiKXGi1/17FK+Gr+QtPndwqj/WymoWJ9uf1Hh22zvRWK7jec1S AeHnC+8vC3HalNMDT7ctrbMbiloezLtEB7Ya2gN56S3gJI4Z2rJw4RMT6KT4VHGsQUyv +x9gyPpuJlH7VazHKIeYmbC++yqfpY5r/GPIw= Received: by 10.142.250.15 with SMTP id x15mr4401214wfh.185.1275720554149; Fri, 04 Jun 2010 23:49:14 -0700 (PDT) Received: from [192.168.1.4] ([58.39.231.84]) by mx.google.com with ESMTPS id 22sm1405110pzk.1.2010.06.04.23.49.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 04 Jun 2010 23:49:13 -0700 (PDT) Message-ID: <4C09F359.1000100@gmail.com> Date: Sat, 05 Jun 2010 14:48:57 +0800 From: Wan ZongShun User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: David Woodhouse , eric.y.miao@gmail.com, linux-arm-kernel , linux-mtd Subject: [PATCH 3/3] MTD/pxa: use resource_size(res) for pxa2xx-flash X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100605_024918_152803_BDB87370 X-CRM114-Status: GOOD ( 14.73 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.3.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is freemail (mcuos.com[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The size calculation is end - start + 1. But,sometimes, the '1' can be forgotten carelessly, witch will have potential risk, so use resource_size should be good habit. Signed-off-by :Wan ZongShun --- drivers/mtd/maps/pxa2xx-flash.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c index 43f8bb8..6ed9a2d 100644 --- a/drivers/mtd/maps/pxa2xx-flash.c +++ b/drivers/mtd/maps/pxa2xx-flash.c @@ -79,7 +79,7 @@ static int __devinit pxa2xx_flash_probe(struct platform_device *pdev) info->map.name = (char *) flash->name; info->map.bankwidth = flash->width; info->map.phys = res->start; - info->map.size = res->end - res->start + 1; + info->map.size = resource_size(res); info->parts = flash->parts; info->nr_parts = flash->nr_parts;