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

From: H Hartley Sweeten
Date: Mon Jun 06 2011 - 17:57:48 EST


On Monday, June 06, 2011 2:53 PM, Joe Perches wrote:
> 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/

Joe,

I think most of the offenders were caught back in late 2009.

I found a couple old patches that I submitted back then that were never acked
so I just updated and reposted them.

Also, I have never looked at coccielle... ;-)

Regards,
Hartley
èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébëæìr¸›zX§»®w¥Š{ayºÊÚë,j­¢f£¢·hš‹àz¹®w¥¢¸ ¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾«‘êçzZ+ƒùšŽŠÝj"ú!¶iO•æ¬z·švØ^¶m§ÿðà nÆàþY&—