From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Markus Armbruster <armbru@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH v2 0/9] Convert ffs(3) to ctz32()
Date: Tue, 17 Mar 2015 15:09:38 +0000 [thread overview]
Message-ID: <1426604987-11363-1-git-send-email-stefanha@redhat.com> (raw)
v2:
* Audit coccinelle patch and split out two cases where ctz32(0) == 32 must be
handled [Peter]
* Cc qemu-stable@nongnu.org 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
next reply other threads:[~2015-03-17 15:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-17 15:09 Stefan Hajnoczi [this message]
2015-03-17 15:09 ` [Qemu-devel] [PATCH v2 1/9] bt-sdp: fix broken uuids power-of-2 calculation Stefan Hajnoczi
2015-03-17 15:09 ` [Qemu-devel] [PATCH v2 2/9] hw/arm/nseries: convert ffs(3) to ctz32() Stefan Hajnoczi
2015-03-17 15:09 ` [Qemu-devel] [PATCH v2 3/9] uninorth: " Stefan Hajnoczi
2015-03-17 15:09 ` [Qemu-devel] [PATCH v2 4/9] Convert (ffs(val) - 1) to ctz32(val) Stefan Hajnoczi
2015-03-17 15:09 ` [Qemu-devel] [PATCH v2 5/9] Convert ffs() != 0 callers to ctz32() Stefan Hajnoczi
2015-03-17 15:09 ` [Qemu-devel] [PATCH v2 6/9] sd: convert sd_normal_command() ffs(3) call " Stefan Hajnoczi
2015-03-17 15:09 ` [Qemu-devel] [PATCH v2 7/9] omap_intc: convert ffs(3) to ctz32() in omap_inth_sir_update() Stefan Hajnoczi
2015-03-17 15:09 ` [Qemu-devel] [PATCH v2 8/9] os-win32: drop ffs(3) prototype Stefan Hajnoczi
2015-03-17 15:09 ` [Qemu-devel] [PATCH v2 9/9] checkpatch: complain about ffs(3) calls Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1426604987-11363-1-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=armbru@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).