2 /// Use vma_pages function on vma object instead of explicit computation.
5 // Keywords: vma_pages vma
6 // Comment: Based on resource_size.cocci
13 //----------------------------------------------------------
15 //----------------------------------------------------------
17 @r_context depends on context && !patch && !org && !report@
18 struct vm_area_struct *vma;
21 * (vma->vm_end - vma->vm_start) >> PAGE_SHIFT
23 //----------------------------------------------------------
25 //----------------------------------------------------------
27 @r_patch depends on !context && patch && !org && !report@
28 struct vm_area_struct *vma;
31 - ((vma->vm_end - vma->vm_start) >> PAGE_SHIFT)
34 //----------------------------------------------------------
36 //----------------------------------------------------------
38 @r_org depends on !context && !patch && (org || report)@
39 struct vm_area_struct *vma;
43 (vma->vm_end@p - vma->vm_start) >> PAGE_SHIFT
45 @script:python depends on report@
50 msg="WARNING: Consider using vma_pages helper on %s" % (x)
51 coccilib.report.print_report(p[0], msg)
53 @script:python depends on org@
58 msg="WARNING: Consider using vma_pages helper on %s" % (x)
59 msg_safe=msg.replace("[","@(").replace("]",")")
60 coccilib.org.print_todo(p[0], msg_safe)