lkml.org 
[lkml]   [2009]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] drivers/i2c: Use resource_size
On Sun, Jul 05, 2009 at 08:37:50AM +0200, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
>
> Use the function resource_size, which reduces the chance of introducing
> off-by-one errors in calculating the resource size.
>
> The semantic patch that makes this change is as follows:
> (http://www.emn.fr/x-info/coccinelle/)
>
> // <smpl>
> @@
> struct resource *res;
> @@
>
> - (res->end - res->start) + 1
> + resource_size(res)
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>

I'll class these as fixes and have applied them to my
tree for linus.

--
Ben (ben@fluff.org, http://www.fluff.org/)

'a smiley only costs 4 bytes'


\
 
 \ /
  Last update: 2009-07-15 00:55    [W:0.073 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site