On 06/07/2017 02:46 AM, Marc-André Lureau wrote:
> The coccinelle/round.cocci script doesn't catch hard coded values.
> 
> I used the following script over qemu code base:
> 
> (
> - ((e1) + 3) / (4)
> + DIV_ROUND_UP(e1,4)

As in 1/5, can't you also write a search for ((e1) + (e2) - 1) / e2, to
cover non-constant divisions?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to