i2c: Use resource_size
authorJulia Lawall <julia@diku.dk>
Sun, 5 Jul 2009 06:37:50 +0000 (08:37 +0200)
committerBen Dooks <ben-linux@fluff.org>
Tue, 14 Jul 2009 23:03:56 +0000 (00:03 +0100)
commit593308259bbd335eda9c5280cdd1f7883c746211
tree60c9882dec12dfa7a262f1d14a81b8318d45d0f4
parent7605fa3b0aedbb6c77471517ba16753f276156d9
i2c: Use resource_size

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>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
drivers/i2c/busses/i2c-davinci.c
drivers/i2c/busses/i2c-omap.c
drivers/i2c/busses/i2c-sh_mobile.c
drivers/i2c/busses/i2c-simtec.c