From patchwork Wed Mar 7 12:44:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 145245 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 D6F22B6EF1 for ; Wed, 7 Mar 2012 23:45:58 +1100 (EST) Received: from localhost ([::1]:50884 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5GFg-0004e9-J3 for incoming@patchwork.ozlabs.org; Wed, 07 Mar 2012 07:45:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5GEy-0003jS-GU for qemu-devel@nongnu.org; Wed, 07 Mar 2012 07:45:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5GEo-0002bW-VI for qemu-devel@nongnu.org; Wed, 07 Mar 2012 07:45:12 -0500 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:41904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5GEo-0002YY-MP for qemu-devel@nongnu.org; Wed, 07 Mar 2012 07:45:02 -0500 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 7 Mar 2012 12:44:58 -0000 Received: from d06nrmr1707.portsmouth.uk.ibm.com (9.149.39.225) by e06smtp16.uk.ibm.com (192.168.101.146) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 7 Mar 2012 12:44:57 -0000 Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q27Ciugr2179094 for ; Wed, 7 Mar 2012 12:44:56 GMT Received: from d06av12.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q27CiuOO017538 for ; Wed, 7 Mar 2012 05:44:56 -0700 Received: from localhost (ptv01652.de.ibm.com [9.145.213.116]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q27CitKk017522; Wed, 7 Mar 2012 05:44:55 -0700 From: Stefan Hajnoczi To: Anthony Liguori Date: Wed, 7 Mar 2012 12:44:39 +0000 Message-Id: <1331124287-6327-6-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1331124287-6327-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1331124287-6327-1-git-send-email-stefanha@linux.vnet.ibm.com> x-cbid: 12030712-3548-0000-0000-0000014536B5 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.112 Cc: Stefan Weil , qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 05/13] block/vmdk: Fix warning from splint (comparision of unsigned value) 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 From: Stefan Weil l1_entry_sectors will never be less than 0. Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- block/vmdk.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 5623ac1..45c003a 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -453,7 +453,7 @@ static int vmdk_open_vmdk4(BlockDriverState *bs, } l1_entry_sectors = le32_to_cpu(header.num_gtes_per_gte) * le64_to_cpu(header.granularity); - if (l1_entry_sectors <= 0) { + if (l1_entry_sectors == 0) { return -EINVAL; } l1_size = (le64_to_cpu(header.capacity) + l1_entry_sectors - 1)