]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit3ae026e49d76ee81933962e2eb214d2876285b2a
tree60c9882dec12dfa7a262f1d14a81b8318d45d0f4
parent1d18f957e343b6c7276ef1b97c48104523339353
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