From patchwork Tue May 17 09:45:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 791092 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4H9kdaY020214 for ; Tue, 17 May 2011 09:48:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753860Ab1EQJsZ (ORCPT ); Tue, 17 May 2011 05:48:25 -0400 Received: from ganesha.gnumonks.org ([213.95.27.120]:45318 "EHLO ganesha.gnumonks.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753846Ab1EQJsY (ORCPT ); Tue, 17 May 2011 05:48:24 -0400 Received: from uucp by ganesha.gnumonks.org with local-bsmtp (Exim 4.69) (envelope-from ) id 1QMGt3-000727-7p; Tue, 17 May 2011 11:48:21 +0200 Received: from [12.23.102.184] (helo=starstone.dsn.sec.samsung.com) by jackpot.kr.gnumonks.org with esmtp (Exim 4.69) (envelope-from ) id 1QMFxv-0004Gs-70; Tue, 17 May 2011 17:49:19 +0900 From: Jingoo Han To: Paul Mundt Cc: linux-fbdev@vger.kernel.org, Ben Dooks , Jingoo Han Subject: [PATCH] video: s3c2410fb: use resource_size() Date: Tue, 17 May 2011 18:45:38 +0900 Message-Id: <1305625538-32302-1-git-send-email-jg1.han@samsung.com> X-Mailer: git-send-email 1.7.1 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 17 May 2011 09:48:25 +0000 (UTC) This patch uses the resource_size help function instead of manually calculating the resource size. It can reduce the chance of introducing off-by-one errors. Signed-off-by: Jingoo Han --- drivers/video/s3c2410fb.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c index 61c819e..4226ec3 100644 --- a/drivers/video/s3c2410fb.c +++ b/drivers/video/s3c2410fb.c @@ -867,7 +867,7 @@ static int __devinit s3c24xxfb_probe(struct platform_device *pdev, goto dealloc_fb; } - size = (res->end - res->start) + 1; + size = resource_size(res); info->mem = request_mem_region(res->start, size, pdev->name); if (info->mem == NULL) { dev_err(&pdev->dev, "failed to get memory region\n");