From patchwork Sat Aug 6 08:48:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Meyer X-Patchwork-Id: 1041212 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p769OdRg018724 for ; Sat, 6 Aug 2011 09:26:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754039Ab1HFJYh (ORCPT ); Sat, 6 Aug 2011 05:24:37 -0400 Received: from www17.your-server.de ([213.133.104.17]:34619 "EHLO www17.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752482Ab1HFJYg (ORCPT ); Sat, 6 Aug 2011 05:24:36 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 06 Aug 2011 09:26:56 +0000 (UTC) X-Greylist: delayed 2130 seconds by postgrey-1.27 at vger.kernel.org; Sat, 06 Aug 2011 05:24:36 EDT Received: from [84.59.143.167] (helo=[192.168.2.108]) by www17.your-server.de with esmtpsa (SSLv3:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1QpcZ6-0005hg-UK; Sat, 06 Aug 2011 10:49:05 +0200 Subject: [PATCH] [media] davinci vpbe: Use resource_size() From: Thomas Meyer To: mchehab@infradead.org, linux-media@vger.kernel.org, Linux Kernel Mailing List Date: Sat, 06 Aug 2011 10:48:32 +0200 X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) Message-ID: <1312620517.5589.36.camel@localhost.localdomain> Mime-Version: 1.0 X-Authenticated-Sender: thomas@m3y3r.de X-Virus-Scanned: Clear (ClamAV 0.97.2/13407/Sat Aug 6 03:59:14 2011) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Thomas Meyer Use resource_size function on resource object instead of explicit computation. The semantic patch that makes this output is available in scripts/coccinelle/api/resource_size.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Thomas Meyer --- -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -u -p a/drivers/media/video/davinci/vpbe_osd.c b/drivers/media/video/davinci/vpbe_osd.c --- a/drivers/media/video/davinci/vpbe_osd.c 2011-07-30 11:10:29.138430171 +0200 +++ b/drivers/media/video/davinci/vpbe_osd.c 2011-08-01 22:50:30.997700024 +0200 @@ -1162,7 +1162,7 @@ static int osd_probe(struct platform_dev goto free_mem; } osd->osd_base_phys = res->start; - osd->osd_size = res->end - res->start + 1; + osd->osd_size = resource_size(res); if (!request_mem_region(osd->osd_base_phys, osd->osd_size, MODULE_NAME)) { dev_err(osd->dev, "Unable to reserve OSD MMIO region\n");