From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LndJP-00028T-KO for qemu-devel@nongnu.org; Sat, 28 Mar 2009 14:31:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LndJK-000251-6O for qemu-devel@nongnu.org; Sat, 28 Mar 2009 14:31:18 -0400 Received: from [199.232.76.173] (port=38000 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LndJK-00024y-28 for qemu-devel@nongnu.org; Sat, 28 Mar 2009 14:31:14 -0400 Received: from verein.lst.de ([213.95.11.210]:43434) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1LndJJ-0006vM-Ja for qemu-devel@nongnu.org; Sat, 28 Mar 2009 14:31:13 -0400 Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id n2SIV9IF025600 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 28 Mar 2009 19:31:09 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id n2SIV9oh025598 for qemu-devel@nongnu.org; Sat, 28 Mar 2009 19:31:09 +0100 Date: Sat, 28 Mar 2009 19:31:09 +0100 From: Christoph Hellwig Message-ID: <20090328183109.GA25497@lst.de> References: <20090314130003.GA24344@lst.de> <20090314133540.GA25440@lst.de> <49CE4E97.7080705@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49CE4E97.7080705@us.ibm.com> Subject: [Qemu-devel] [PATCH] remove dead code in bdrv_check_request Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Remove code dealing with negative sector numbers for byte access in bdrv_check_request as sector numbers can't ever be negative. Previously we supported negative sector counts for byte access, but never sector numbers. Signed-off-by: Christoph Hellwig Index: qemu/block.c =================================================================== --- qemu.orig/block.c 2009-03-14 14:34:49.000000000 +0100 +++ qemu/block.c 2009-03-14 14:35:12.000000000 +0100 @@ -546,15 +546,7 @@ static int bdrv_check_byte_request(Block static int bdrv_check_request(BlockDriverState *bs, int64_t sector_num, int nb_sectors) { - int64_t offset; - - /* Deal with byte accesses */ - if (sector_num < 0) - offset = -sector_num; - else - offset = sector_num * 512; - - return bdrv_check_byte_request(bs, offset, nb_sectors * 512); + return bdrv_check_byte_request(bs, sector_num * 512, nb_sectors * 512); } /* return < 0 if error. See bdrv_write() for the return codes */