Input: use resource_size when allocating resources
authorJulia Lawall <julia@diku.dk>
Wed, 8 Jul 2009 05:04:55 +0000 (22:04 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 8 Jul 2009 05:48:14 +0000 (22:48 -0700)
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: Dmitry Torokhov <dtor@mail.ru>

No differences found