From nobody Mon May 6 11:53:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1553890200452968.6346112839205; Fri, 29 Mar 2019 13:10:00 -0700 (PDT) Received: from localhost ([127.0.0.1]:59551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9xox-0006eM-2i for importer@patchew.org; Fri, 29 Mar 2019 16:09:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h9xns-00063w-Mn for qemu-devel@nongnu.org; Fri, 29 Mar 2019 16:08:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h9xnp-0006ii-2o for qemu-devel@nongnu.org; Fri, 29 Mar 2019 16:08:39 -0400 Received: from mga11.intel.com ([192.55.52.93]:47440) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h9xnn-0006Zm-0L for qemu-devel@nongnu.org; Fri, 29 Mar 2019 16:08:35 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Mar 2019 13:08:25 -0700 Received: from unknown (HELO localhost.localdomain) ([10.239.13.19]) by FMSMGA003.fm.intel.com with ESMTP; 29 Mar 2019 13:08:25 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,285,1549958400"; d="scan'208";a="145023101" From: Zhang Chen To: "Dr. David Alan Gilbert" , qemu-dev , John Snow , Fam Zheng Date: Sat, 30 Mar 2019 04:04:45 +0800 Message-Id: <20190329200445.28512-1-chen.zhang@intel.com> X-Mailer: git-send-email 2.17.GIT X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.93 Subject: [Qemu-devel] [PATCH] bitops.h: Remove unused bitops function test_and_change_bit() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Chen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Zhang Chen In current codes we use change_bit() to finish the job. Signed-off-by: Zhang Chen Reviewed-by: John Snow --- include/qemu/bitmap.h | 1 - include/qemu/bitops.h | 15 --------------- 2 files changed, 16 deletions(-) diff --git a/include/qemu/bitmap.h b/include/qemu/bitmap.h index 5c313346b9..6b71ef631c 100644 --- a/include/qemu/bitmap.h +++ b/include/qemu/bitmap.h @@ -52,7 +52,6 @@ * test_bit(bit, addr) Is bit set in *addr? * test_and_set_bit(bit, addr) Set bit and return old value * test_and_clear_bit(bit, addr) Clear bit and return old value - * test_and_change_bit(bit, addr) Change bit and return old value * find_first_zero_bit(addr, nbits) Position first zero bit in *addr * find_first_bit(addr, nbits) Position first set bit in *addr * find_next_zero_bit(addr, nbits, bit) Position next zero bit in *addr >= =3D bit diff --git a/include/qemu/bitops.h b/include/qemu/bitops.h index 3f0926cf40..1f98ffcdc0 100644 --- a/include/qemu/bitops.h +++ b/include/qemu/bitops.h @@ -109,21 +109,6 @@ static inline int test_and_clear_bit(long nr, unsigned= long *addr) return (old & mask) !=3D 0; } =20 -/** - * test_and_change_bit - Change a bit and return its old value - * @nr: Bit to change - * @addr: Address to count from - */ -static inline int test_and_change_bit(long nr, unsigned long *addr) -{ - unsigned long mask =3D BIT_MASK(nr); - unsigned long *p =3D addr + BIT_WORD(nr); - unsigned long old =3D *p; - - *p =3D old ^ mask; - return (old & mask) !=3D 0; -} - /** * test_bit - Determine whether a bit is set * @nr: bit number to test --=20 2.17.GIT