[RFC] Convert "resource->end - resource->start + 1" toresource_size(resource) via coccinelle

From: Joe Perches
Date: Mon Jun 06 2011 - 17:53:01 EST


On Mon, 2011-06-06 at 13:49 -0700, H Hartley Sweeten wrote:
> Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
> Cc: Dan Williams <dan.j.williams@xxxxxxxxx> (supporter:ASYNCHRONOUS TRAN...)
> Cc: Vinod Koul <vinod.koul@xxxxxxxxx> (supporter:DMA GENERIC OFFLO...)

Perhaps do a treewide update via:

$ cat resource.cocci
@@
struct resource *ptr;
@@

- ptr->end - ptr->start + 1
+ resource_size(ptr)

$ spatch -sp_file resource.cocci linux-2.6/


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/