qemu-e2k/hw/sd
Stefan Hajnoczi c9d9331851 sd: convert sd_normal_command() ffs(3) call to ctz32()
ffs() cannot be replaced with ctz32() when the argument might be zero,
because ffs(0) returns 0 while ctz32(0) returns 32.

The ffs(3) call in sd_normal_command() is a special case though.  It can
be converted to ctz32() + 1 because the argument is never zero:

  if (!(req.arg >> 8) || (req.arg >> (ctz32(req.arg & ~0xff) + 1))) {
      ~~~~~~~~~~~~~~~
            ^--------------- req.arg cannot be zero

Cc: Markus Armbruster <armbru@redhat.com>
Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1427124571-28598-7-git-send-email-stefanha@redhat.com
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2015-04-28 15:36:08 +02:00
..
Makefile.objs hw: move SD/MMC devices to hw/sd/, configure with default-configs/ 2013-04-08 18:13:14 +02:00
milkymist-memcard.c sysbus: Make devices picking up backends unavailable with -device 2015-04-02 15:30:44 +02:00
omap_mmc.c omap: Fix warnings from Sparse 2015-03-19 11:11:55 +03:00
pl181.c sysbus: Make devices picking up backends unavailable with -device 2015-04-02 15:30:44 +02:00
pxa2xx_mmci.c hw: Convert from BlockDriverState to BlockBackend, mostly 2014-10-20 14:02:25 +02:00
sd.c sd: convert sd_normal_command() ffs(3) call to ctz32() 2015-04-28 15:36:08 +02:00
sdhci.c sysbus: Make devices picking up backends unavailable with -device 2015-04-02 15:30:44 +02:00
sdhci.h sdhci: Support SDHCI devices on PCI 2014-12-15 17:34:44 +01:00
ssi-sd.c hw: Mark devices picking up block backends actively FIXME 2015-04-02 15:26:27 +02:00