From patchwork Mon Jun 14 18:55:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 55573 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D0AABB7D4F for ; Tue, 15 Jun 2010 04:58:12 +1000 (EST) Received: from localhost ([127.0.0.1]:59200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOErJ-0006Ve-Cy for incoming@patchwork.ozlabs.org; Mon, 14 Jun 2010 14:58:09 -0400 Received: from [140.186.70.92] (port=57297 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOEp9-0005Au-Jb for qemu-devel@nongnu.org; Mon, 14 Jun 2010 14:55:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOEp8-0005hJ-JL for qemu-devel@nongnu.org; Mon, 14 Jun 2010 14:55:55 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:33921) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOEp8-0005h5-Cf for qemu-devel@nongnu.org; Mon, 14 Jun 2010 14:55:54 -0400 Received: by pwj8 with SMTP id 8so3084526pwj.4 for ; Mon, 14 Jun 2010 11:55:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=TJULyviUfFcEszcu8okU1xuPVqb3Sx6VBepXTTZKWJ8=; b=kGF1PV2y2xxppeDCbMgDXVPEQQUqS/UB2xyZeul9Wo1kMpv5DVuFcV5D5xBnU03F4l EjuifyhcbAzfwbH9pfcO/1CZ016Fv4O+TKq89LtxFMw4OHKsQXlq9CfR7R8bQcxN6E41 tCvp9sd/o+8HMuzxmd/TPyoggBgDem6IgvwVo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=FhcYsD6QVI2AXNN15MsEJmalIZtqYyV538K8e3Ol/zof8gaglag6Y74jobOKXNPZC7 fikAFClBJVb9TYcsrAnuPV5pxdSE6+LggOcbMOuj3QRwCBkBszQcCRVdtG7AZW4z5FOf inu+iiu71rjSXyLMXWUepBFgOXlA0vuasa7lk= Received: by 10.140.251.19 with SMTP id y19mr4810389rvh.161.1276541753065; Mon, 14 Jun 2010 11:55:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.141.44.12 with HTTP; Mon, 14 Jun 2010 11:55:33 -0700 (PDT) From: Blue Swirl Date: Mon, 14 Jun 2010 18:55:33 +0000 Message-ID: To: Kevin Wolf , qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Subject: [Qemu-devel] [PATCH] block: fix a warning and possible truncation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Fix a warning from OpenBSD gcc (3.3.5 (propolice)): /src/qemu/block.c: In function `bdrv_info_stats_bs': /src/qemu/block.c:1548: warning: long long int format, long unsigned int arg (arg 6) There may be also truncation effects. Signed-off-by: Blue Swirl --- Alternatively 'ULL' prefix could be appended to BDRV_SECTOR_SIZE definition but that may have other side effects. block.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/block.c b/block.c index cacf11b..a7ab0b4 100644 --- a/block.c +++ b/block.c @@ -1545,7 +1545,8 @@ static QObject* bdrv_info_stats_bs(BlockDriverState *bs) "} }", bs->rd_bytes, bs->wr_bytes, bs->rd_ops, bs->wr_ops, - bs->wr_highest_sector * (long)BDRV_SECTOR_SIZE); + bs->wr_highest_sector * + (uint64_t)BDRV_SECTOR_SIZE); dict = qobject_to_qdict(res); if (*bs->device_name) {