Received: from eggs.gnu.org ([2001:4830:134:3::10]:60921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yal3Z-0003dE-Mb for qemu-devel@nongnu.org; Wed, 25 Mar 2015 09:09:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yal3V-0007LO-VB for qemu-devel@nongnu.org; Wed, 25 Mar 2015 09:09:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41378) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yal3V-0007LH-ND for qemu-devel@nongnu.org; Wed, 25 Mar 2015 09:09:09 -0400 Date: Wed, 25 Mar 2015 13:09:07 +0000 From: Stefan Hajnoczi Message-ID: <20150325130907.GG22940@stefanha-thinkpad.redhat.com> References: <1427124571-28598-1-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9/eUdp+dLtKXvemk" Content-Disposition: inline In-Reply-To: <1427124571-28598-1-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 0/9] Convert ffs(3) to ctz32() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Markus Armbruster , Peter Maydell --9/eUdp+dLtKXvemk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 23, 2015 at 03:29:22PM +0000, Stefan Hajnoczi wrote: > v3: > * Use Paolo's much cleaner rewrite of the omap intc loop [Paolo] > * Rebased on qemu.git/master >=20 > v2: > * Audit coccinelle patch and split out two cases where ctz32(0) =3D=3D 3= 2 must be > handled [Peter] > * Cc qemu-stable@nongnu.org on first patch [Eric] >=20 > MinGW does not always provide ffs(3). My MinGW 4.9.2 cannot link QEMU wh= en > ./configure --enable-debug was used due to the missing ffs(3) function. >=20 > In the past we already got rid of ffsl(3) calls, so getting rid of ffs(3)= is a > logical next step. >=20 > This series replaces ffs(3) calls with ctz32(). Their semantics differ a= s follows: >=20 > 1. ffs(0) =3D=3D 0 but ctz32(0) =3D=3D 32 >=20 > 2. Otherwise, ffs(val) - 1 =3D=3D ctz32(val) >=20 > The first patch fixes a bug that was discovered when auditing ffs(3) call= ers. >=20 > 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. >=20 > 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. >=20 > Paolo Bonzini (1): > omap_intc: convert ffs(3) to ctz32() in omap_inth_sir_update() >=20 > Stefan Hajnoczi (8): > 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() !=3D 0 callers to ctz32() > sd: convert sd_normal_command() ffs(3) call to ctz32() > os-win32: drop ffs(3) prototype > checkpatch: complain about ffs(3) calls >=20 > 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 | 9 +++++---- > 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, 103 insertions(+), 88 deletions(-) Applied to my block-next tree: https://github.com/stefanha/qemu/commits/block-next Stefan --9/eUdp+dLtKXvemk Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVErNzAAoJEJykq7OBq3PIzrsH/1uEa2SsdA5As7Z0MqtjLwdU xMO9iblB+mY53HFMo/KCDfVQde8HzQABbXxjpkBuSjZvto4uM3XZKmDevavXM4XZ Lw383OySTzFRfVG61tD07/yCJA13KuQ7UH/ypd1+7Mx5eq2lcqTnTg2BwAK7updo nRVm6IGrh4Poyjz7czCJGhCkd7tHP3La+oOCNSQQ8IRAuQkyKj9iEGlMq5TWn0Yv God5PBWESaK50ddAohZ+oTHEkPEl90cj3uA67/EcCoje6EoeGVnudqo4LZjzlizz pNM4ISMTlp3fO3+dUnj1nfOxbsKS+Qixzx8YqkBIk1DIOFesF4/TaOvWLvKRLC8= =Sd0Q -----END PGP SIGNATURE----- --9/eUdp+dLtKXvemk--