[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 0/9] Convert ffs(3) to ctz32()
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH v2 0/9] Convert ffs(3) to ctz32() |
Date: |
Tue, 17 Mar 2015 15:09:38 +0000 |
v2:
* Audit coccinelle patch and split out two cases where ctz32(0) == 32 must be
handled [Peter]
* Cc address@hidden on first patch [Eric]
MinGW does not always provide ffs(3). My MinGW 4.9.2 cannot link QEMU when
./configure --enable-debug was used due to the missing ffs(3) function.
In the past we already got rid of ffsl(3) calls, so getting rid of ffs(3) is a
logical next step.
This series replaces ffs(3) calls with ctz32(). Their semantics differ as
follows:
1. ffs(0) == 0 but ctz32(0) == 32
2. Otherwise, ffs(val) - 1 == ctz32(val)
The first patch fixes a bug that was discovered when auditing ffs(3) callers.
The final patch adds checkpatch.pl support to prevent ffs(3), ffsl(3), and
ffsll(3) from being introduced into the codebase again in the future.
Note that there are instances of 64-bit values being passed to ffs(3). I have
mechanically converted them to ctz32() and not worried about whether the
original code is buggy or not.
Stefan Hajnoczi (9):
bt-sdp: fix broken uuids power-of-2 calculation
hw/arm/nseries: convert ffs(3) to ctz32()
uninorth: convert ffs(3) to ctz32()
Convert (ffs(val) - 1) to ctz32(val)
Convert ffs() != 0 callers to ctz32()
sd: convert sd_normal_command() ffs(3) call to ctz32()
omap_intc: convert ffs(3) to ctz32() in omap_inth_sir_update()
os-win32: drop ffs(3) prototype
checkpatch: complain about ffs(3) calls
block.c | 2 +-
block/qcow2-refcount.c | 2 +-
block/qcow2.c | 4 ++--
block/qed.c | 4 ++--
block/rbd.c | 2 +-
block/sheepdog.c | 2 +-
hw/acpi/pcihp.c | 2 +-
hw/arm/nseries.c | 5 ++++-
hw/arm/omap1.c | 6 ++----
hw/arm/pxa2xx_gpio.c | 2 +-
hw/arm/strongarm.c | 4 ++--
hw/bt/sdp.c | 2 +-
hw/char/virtio-serial-bus.c | 8 ++++----
hw/display/tc6393xb.c | 2 +-
hw/gpio/max7310.c | 2 +-
hw/gpio/omap_gpio.c | 13 +++++--------
hw/gpio/zaurus.c | 2 +-
hw/i2c/omap_i2c.c | 10 +++++++---
hw/intc/allwinner-a10-pic.c | 8 ++++----
hw/intc/omap_intc.c | 7 ++++---
hw/pci-host/bonito.c | 2 +-
hw/pci-host/uninorth.c | 5 ++++-
hw/pci/msi.c | 12 ++++++------
hw/pci/pcie_aer.c | 2 +-
hw/pci/shpc.c | 10 +++++-----
hw/pci/slotid_cap.c | 2 +-
hw/ppc/ppce500_spin.c | 2 +-
hw/scsi/megasas.c | 2 +-
hw/sd/sd.c | 3 ++-
include/hw/pci/pci.h | 16 ++++++++--------
include/hw/pci/pcie_regs.h | 18 +++++++++---------
include/sysemu/os-win32.h | 3 ---
kvm-all.c | 8 ++++----
scripts/checkpatch.pl | 11 +++++++++++
target-ppc/cpu.h | 4 ++--
35 files changed, 102 insertions(+), 87 deletions(-)
--
2.1.0
- [Qemu-devel] [PATCH v2 0/9] Convert ffs(3) to ctz32(),
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH v2 1/9] bt-sdp: fix broken uuids power-of-2 calculation, Stefan Hajnoczi, 2015/03/17
- [Qemu-devel] [PATCH v2 4/9] Convert (ffs(val) - 1) to ctz32(val), Stefan Hajnoczi, 2015/03/17
- [Qemu-devel] [PATCH v2 3/9] uninorth: convert ffs(3) to ctz32(), Stefan Hajnoczi, 2015/03/17
- [Qemu-devel] [PATCH v2 6/9] sd: convert sd_normal_command() ffs(3) call to ctz32(), Stefan Hajnoczi, 2015/03/17
- [Qemu-devel] [PATCH v2 2/9] hw/arm/nseries: convert ffs(3) to ctz32(), Stefan Hajnoczi, 2015/03/17
- [Qemu-devel] [PATCH v2 7/9] omap_intc: convert ffs(3) to ctz32() in omap_inth_sir_update(), Stefan Hajnoczi, 2015/03/17
- [Qemu-devel] [PATCH v2 5/9] Convert ffs() != 0 callers to ctz32(), Stefan Hajnoczi, 2015/03/17
- [Qemu-devel] [PATCH v2 8/9] os-win32: drop ffs(3) prototype, Stefan Hajnoczi, 2015/03/17
- [Qemu-devel] [PATCH v2 9/9] checkpatch: complain about ffs(3) calls, Stefan Hajnoczi, 2015/03/17