diff options
| author | Stefan Hajnoczi | 2015-03-23 16:29:27 +0100 |
|---|---|---|
| committer | Kevin Wolf | 2015-04-28 15:36:08 +0200 |
| commit | bd2a88840e2496e29442f333c8fdd6491e831a35 (patch) | |
| tree | 95ced0dfbbd8ac39d8e73b55a414398dccb106ad /scripts/qapi.py | |
| parent | Convert (ffs(val) - 1) to ctz32(val) (diff) | |
| download | qemu-bd2a88840e2496e29442f333c8fdd6491e831a35.tar.gz qemu-bd2a88840e2496e29442f333c8fdd6491e831a35.tar.xz qemu-bd2a88840e2496e29442f333c8fdd6491e831a35.zip | |
Convert ffs() != 0 callers to ctz32()
There are a number of ffs(3) callers that do roughly:
bit = ffs(val);
if (bit) {
do_something(bit - 1);
}
This pattern can be converted to ctz32() like this:
zeroes = ctz32(val);
if (zeroes != 32) {
do_something(zeroes);
}
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1427124571-28598-6-git-send-email-stefanha@redhat.com
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'scripts/qapi.py')
0 files changed, 0 insertions, 0 deletions
