Re: [PATCH 5/5] drivers/i2c: Use resource_size

From: Ben Dooks
Date: Tue Jul 14 2009 - 18:53:50 EST


On Sun, Jul 05, 2009 at 08:37:50AM +0200, Julia Lawall wrote:
> From: Julia Lawall <julia@xxxxxxx>
>
> 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@xxxxxxx>

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

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

'a smiley only costs 4 bytes'
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/