]> git.baikalelectronics.ru Git - kernel.git/commit
drivers/ata: use resource_size
authorJulia Lawall <julia@diku.dk>
Thu, 6 Aug 2009 23:05:08 +0000 (16:05 -0700)
committerJeff Garzik <jgarzik@redhat.com>
Fri, 11 Sep 2009 06:25:58 +0000 (02:25 -0400)
commit85b7e33980d57b1c4e6724a59f2f5d5871ec153f
treea1abcfd2b97985ca06504c493fda9cd4123307aa
parent07d8b91374c3cb8246a144a1660ec9942391d5ad
drivers/ata: 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>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/pata_octeon_cf.c
drivers/ata/pata_platform.c
drivers/ata/pata_rb532_cf.c
drivers/ata/sata_mv.c