diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2015-03-23 15:29:28 +0000 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2015-04-28 15:36:08 +0200 |
commit | c9d933185181cb1cf81bc4c9e5c3a10a5934b017 (patch) | |
tree | 0f0965841808c3ec2cae78e9bc8eaf3bb32d4f8f /Makefile | |
parent | bd2a88840e2496e29442f333c8fdd6491e831a35 (diff) | |
download | qemu-c9d933185181cb1cf81bc4c9e5c3a10a5934b017.zip qemu-c9d933185181cb1cf81bc4c9e5c3a10a5934b017.tar.gz qemu-c9d933185181cb1cf81bc4c9e5c3a10a5934b017.tar.bz2 |
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>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions