]> git.proxmox.com Git - mirror_qemu.git/commit - block/qed.c
Convert (ffs(val) - 1) to ctz32(val)
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 23 Mar 2015 15:29:26 +0000 (15:29 +0000)
committerKevin Wolf <kwolf@redhat.com>
Tue, 28 Apr 2015 13:36:08 +0000 (15:36 +0200)
commit786a4ea82ec9c87e3a895cf41081029b285a5fe5
treefe42f1059c13ea9a27bc9515e5d440d3bb354773
parent5863d374a32c98a7adb4c5e49d62de3cdc16d2ea
Convert (ffs(val) - 1) to ctz32(val)

This commit was generated mechanically by coccinelle from the following
semantic patch:

@@
expression val;
@@
- (ffs(val) - 1)
+ ctz32(val)

The call sites have been audited to ensure the ffs(0) - 1 == -1 case
never occurs (due to input validation, asserts, etc).  Therefore we
don't need to worry about the fact that ctz32(0) == 32.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1427124571-28598-5-git-send-email-stefanha@redhat.com
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
22 files changed:
block.c
block/qcow2-refcount.c
block/qcow2.c
block/qed.c
block/rbd.c
block/sheepdog.c
hw/acpi/pcihp.c
hw/arm/pxa2xx_gpio.c
hw/arm/strongarm.c
hw/display/tc6393xb.c
hw/gpio/max7310.c
hw/gpio/zaurus.c
hw/pci-host/bonito.c
hw/pci/msi.c
hw/pci/pcie_aer.c
hw/pci/shpc.c
hw/pci/slotid_cap.c
hw/ppc/ppce500_spin.c
hw/scsi/megasas.c
include/hw/pci/pci.h
include/hw/pci/pcie_regs.h
target-ppc/cpu.h