hwmon: Use resource_size
authorJulia Lawall <julia@diku.dk>
Tue, 15 Sep 2009 15:18:13 +0000 (17:18 +0200)
committerJean Delvare <khali@linux-fr.org>
Tue, 15 Sep 2009 15:18:13 +0000 (17:18 +0200)
commit86855b0c1fd75338c67cabbf85d64d033612c47b
tree69b20b9059bc9d317fcb68a77ce988acce8577ef
parent6055fae8aceee41471edfd1876e5617d16e028fe
hwmon: 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: Jean Delvare <khali@linux-fr.org>
drivers/hwmon/pc87427.c
drivers/hwmon/vt1211.c