1*2c2f96dcSApple OSS Distributions// To apply, at the top of xnu.git: 2*2c2f96dcSApple OSS Distributions// $ spatch --max-width=80 --use-gitgrep --in-place --include-headers --sp-file tools/cocci/zalloc.cocci -dir . 3*2c2f96dcSApple OSS Distributions// 4*2c2f96dcSApple OSS Distributions// This might need to be run several times 5*2c2f96dcSApple OSS Distributions 6*2c2f96dcSApple OSS Distributions@ using "zalloc.iso" @ 7*2c2f96dcSApple OSS Distributionsexpression E, F, G; 8*2c2f96dcSApple OSS Distributionstype T; 9*2c2f96dcSApple OSS Distributionsidentifier V; 10*2c2f96dcSApple OSS Distributions@@ 11*2c2f96dcSApple OSS Distributions( 12*2c2f96dcSApple OSS Distributions 13*2c2f96dcSApple OSS Distributions( 14*2c2f96dcSApple OSS Distributions E = zalloc_flags(F, \(Z_ZERO\|Z_ZERO | ...\)); 15*2c2f96dcSApple OSS Distributions| 16*2c2f96dcSApple OSS Distributions E = kalloc_type(F, \(Z_ZERO\|Z_ZERO | ...\)); 17*2c2f96dcSApple OSS Distributions| 18*2c2f96dcSApple OSS Distributions E = \(kalloc_data\|kalloc_flags\)(F, \(Z_ZERO\|Z_ZERO | ...\)); 19*2c2f96dcSApple OSS Distributions| 20*2c2f96dcSApple OSS Distributions- E = zalloc(F); 21*2c2f96dcSApple OSS Distributions+ E = zalloc_flags(F, Z_WAITOK | Z_ZERO); 22*2c2f96dcSApple OSS Distributions| 23*2c2f96dcSApple OSS Distributions E = zalloc_flags(F, \(Z_WAITOK\| Z_WAITOK | ...\) 24*2c2f96dcSApple OSS Distributions+ | Z_ZERO 25*2c2f96dcSApple OSS Distributions ); 26*2c2f96dcSApple OSS Distributions) 27*2c2f96dcSApple OSS Distributions ... 28*2c2f96dcSApple OSS Distributions- bzero(E, G); 29*2c2f96dcSApple OSS Distributions 30*2c2f96dcSApple OSS Distributions| 31*2c2f96dcSApple OSS Distributions 32*2c2f96dcSApple OSS Distributions( 33*2c2f96dcSApple OSS Distributions- E = kalloc(F); 34*2c2f96dcSApple OSS Distributions+ E = kalloc_flags(F, Z_WAITOK | Z_ZERO); 35*2c2f96dcSApple OSS Distributions| 36*2c2f96dcSApple OSS Distributions E = kalloc_type(T, \(Z_WAITOK\| Z_WAITOK | ...\) 37*2c2f96dcSApple OSS Distributions+ | Z_ZERO 38*2c2f96dcSApple OSS Distributions ); 39*2c2f96dcSApple OSS Distributions| 40*2c2f96dcSApple OSS Distributions E = \(kalloc_data\|kalloc_flags\)(F, \(Z_WAITOK\| Z_WAITOK | ...\) 41*2c2f96dcSApple OSS Distributions+ | Z_ZERO 42*2c2f96dcSApple OSS Distributions ); 43*2c2f96dcSApple OSS Distributions) 44*2c2f96dcSApple OSS Distributions ... 45*2c2f96dcSApple OSS Distributions- bzero(E, F); 46*2c2f96dcSApple OSS Distributions 47*2c2f96dcSApple OSS Distributions| 48*2c2f96dcSApple OSS Distributions 49*2c2f96dcSApple OSS Distributions 50*2c2f96dcSApple OSS Distributions- T V = zalloc(F); 51*2c2f96dcSApple OSS Distributions+ T V = zalloc_flags(F, Z_WAITOK | Z_ZERO); 52*2c2f96dcSApple OSS Distributions ... 53*2c2f96dcSApple OSS Distributions- bzero(V, G); 54*2c2f96dcSApple OSS Distributions 55*2c2f96dcSApple OSS Distributions| 56*2c2f96dcSApple OSS Distributions 57*2c2f96dcSApple OSS Distributions( 58*2c2f96dcSApple OSS Distributions T V = zalloc_flags(F, \(Z_ZERO\|Z_ZERO | ...\)); 59*2c2f96dcSApple OSS Distributions| 60*2c2f96dcSApple OSS Distributions T V = kalloc_type(T, \(Z_ZERO\|Z_ZERO | ...\)); 61*2c2f96dcSApple OSS Distributions| 62*2c2f96dcSApple OSS Distributions T V = \(kalloc_data\|kalloc_flags\)(F, \(Z_ZERO\|Z_ZERO | ...\)); 63*2c2f96dcSApple OSS Distributions| 64*2c2f96dcSApple OSS Distributions- T V = kalloc(F); 65*2c2f96dcSApple OSS Distributions+ T V = kalloc_flags(F, Z_WAITOK | Z_ZERO); 66*2c2f96dcSApple OSS Distributions| 67*2c2f96dcSApple OSS Distributions T V = kalloc_type(T, \(Z_WAITOK\| Z_WAITOK | ...\) 68*2c2f96dcSApple OSS Distributions+ | Z_ZERO 69*2c2f96dcSApple OSS Distributions ); 70*2c2f96dcSApple OSS Distributions| 71*2c2f96dcSApple OSS Distributions T V = \(zalloc_flags\|kalloc_data\|kalloc_flags\)(F, \(Z_WAITOK\| Z_WAITOK | ...\) 72*2c2f96dcSApple OSS Distributions+ | Z_ZERO 73*2c2f96dcSApple OSS Distributions ); 74*2c2f96dcSApple OSS Distributions) 75*2c2f96dcSApple OSS Distributions ... 76*2c2f96dcSApple OSS Distributions- bzero(V, F); 77*2c2f96dcSApple OSS Distributions 78*2c2f96dcSApple OSS Distributions) 79*2c2f96dcSApple OSS Distributions 80*2c2f96dcSApple OSS Distributions// vim:ft=diff: 81