On 06/07/2017 02:46 AM, Marc-André Lureau wrote:
> I used a the following coccinelle script:
>
> @@
> expression e1;
> @@
> - ((e1) + (3)) / (4) * (4)
> + ROUND_UP(e1,4)
Can't you also search for:
@@
expression e1, e2
@@
- ((e1) + (e2 - 1)) / (e2) * (e2)
+ ROUND_UP(e1, e2)
to catch cases where
Marc-André Lureau wrote:
> I used a the following coccinelle script:
>
> @@
> expression e1;
> @@
> - ((e1) + (3)) / (4) * (4)
> + ROUND_UP(e1,4)
>
> @@
> expression e1;
> expression e2;
> @@
> -(ROUND_UP(e1,e2))
> +ROUND_UP(e1,e2)
>
> I tried with various other values (4, 8, 16, 32), but got only
I used a the following coccinelle script:
@@
expression e1;
@@
- ((e1) + (3)) / (4) * (4)
+ ROUND_UP(e1,4)
@@
expression e1;
expression e2;
@@
-(ROUND_UP(e1,e2))
+ROUND_UP(e1,e2)
I tried with various other values (4, 8, 16, 32), but got only the
matches in this patch.
Signed-off-by: Marc-André