From patchwork Thu Feb 14 01:47:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 220316 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8A8492C0089 for ; Thu, 14 Feb 2013 13:02:37 +1100 (EST) Received: from localhost ([::1]:55458 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5o9i-0002jJ-OJ for incoming@patchwork.ozlabs.org; Wed, 13 Feb 2013 21:02:34 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5nvy-0007zU-NU for qemu-devel@nongnu.org; Wed, 13 Feb 2013 20:48:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5nvs-0006Ou-Su for qemu-devel@nongnu.org; Wed, 13 Feb 2013 20:48:22 -0500 Received: from mail-da0-f44.google.com ([209.85.210.44]:50755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5nvr-0006N7-JQ for qemu-devel@nongnu.org; Wed, 13 Feb 2013 20:48:16 -0500 Received: by mail-da0-f44.google.com with SMTP id z20so851951dae.17 for ; Wed, 13 Feb 2013 17:48:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=A8wVn6gZSmfMy2JGPVILA/Fze4+xzBUJ+4LtJz2IhcA=; b=hRuii6B4WJmTlBiIN8WTWUsSlwNJwwjacP9vCJpfYymoEcCNxjITSq7KkIolMCM/W+ iiq7+k8e6zqKxW8mx7jDDbcoB2BflLH6C0wNS5VkwezpAuBBiW2jOqhy6U0zfYA60Xnv G7GgiHGT0skHFLw8AQCni9cbrkmJCCoMUi49t56taC8t7p2zFKR7kB0JvY0V9yJMA4xG 3zbabPmpeCt+9+g54OatEn4mjL5ePUMmExz6nayK8hPjMoCnRRtXLotSEDssZJQ8g/5h MoztV++Vse455fWF588U8c44g5+2MZHn2svmXic/PptuxvY8c7i/158gyoauaKHnQNoI PP4A== X-Received: by 10.66.79.135 with SMTP id j7mr70116237pax.0.1360806485030; Wed, 13 Feb 2013 17:48:05 -0800 (PST) Received: from pebble.twiddle.net (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPS id c3sm44029148pax.9.2013.02.13.17.48.03 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 13 Feb 2013 17:48:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 13 Feb 2013 17:47:43 -0800 Message-Id: <1360806463-23632-11-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1360806463-23632-1-git-send-email-rth@twiddle.net> References: <1360806463-23632-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.210.44 Cc: blauwirbel@gmail.com Subject: [Qemu-devel] [PATCH 10/10] bitops: Remove routines redundant with host-utils X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Richard Henderson --- include/qemu/bitops.h | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h index b50629b..affcc96 100644 --- a/include/qemu/bitops.h +++ b/include/qemu/bitops.h @@ -24,54 +24,6 @@ #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) /** - * bitops_ctzl - count trailing zeroes in word. - * @word: The word to search - * - * Returns -1 if no bit exists. Note that compared to the C library - * routine ffsl, this one returns one less. - */ -static unsigned long bitops_ctzl(unsigned long word) -{ -#if QEMU_GNUC_PREREQ(3, 4) - return __builtin_ffsl(word) - 1; -#else - if (!word) { - return -1; - } - - if (sizeof(long) == 4) { - return ctz32(word); - } else if (sizeof(long) == 8) { - return ctz64(word); - } else { - abort(); - } -#endif -} - -/** - * bitops_fls - find last (most-significant) set bit in a long word - * @word: the word to search - * - * Undefined if no set bit exists, so code should check against 0 first. - */ -static inline unsigned long bitops_flsl(unsigned long word) -{ - return BITS_PER_LONG - 1 - clzl(word); -} - -/** - * cto - count trailing ones in word. - * @word: The word to search - * - * Returns -1 if all bit are set. - */ -static inline unsigned long bitops_ctol(unsigned long word) -{ - return bitops_ctzl(~word); -} - -/** * set_bit - Set a bit in memory * @nr: the bit to set * @addr: the address to start counting from