From mboxrd@z Thu Jan 1 00:00:00 1970 From: ehrhardt@linux.vnet.ibm.com Date: Mon, 13 Oct 2008 12:07:41 +0000 Subject: [PATCH 3/3] kvmppc: optimize find first bit Message-Id: <1223899663-23210-2-git-send-email-ehrhardt@linux.vnet.ibm.com> List-Id: References: <1223636372-8946-2-git-send-email-ehrhardt@linux.vnet.ibm.com> In-Reply-To: <1223636372-8946-2-git-send-email-ehrhardt@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org From: Christian Ehrhardt Since we use a unsigned long here anyway we can use the optimized __ffs. Signed-off-by: Christian Ehrhardt --- [diffstat] booke_guest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) [diff] diff --git a/arch/powerpc/kvm/booke_guest.c b/arch/powerpc/kvm/booke_guest.c --- a/arch/powerpc/kvm/booke_guest.c +++ b/arch/powerpc/kvm/booke_guest.c @@ -180,7 +180,7 @@ unsigned int prio; u32 mask; - prio = find_first_bit(pending, BITS_PER_BYTE * sizeof(*pending)); + prio = __ffs(*pending); while (prio <= BOOKE_MAX_INTERRUPT) { if (kvmppc_can_deliver_interrupt_by_prio(vcpu, prio, &mask)) { kvmppc_clear_exception_by_prio(pending, prio);