From patchwork Fri Jul 6 06:57:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 169344 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 184032C007C for ; Fri, 6 Jul 2012 17:00:05 +1000 (EST) Received: from localhost ([::1]:34950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sn2WJ-0006DK-1b for incoming@patchwork.ozlabs.org; Fri, 06 Jul 2012 03:00:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sn2Uj-0003EK-KZ for qemu-devel@nongnu.org; Fri, 06 Jul 2012 02:58:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sn2Ud-0003OL-9O for qemu-devel@nongnu.org; Fri, 06 Jul 2012 02:58:25 -0400 Received: from oxygen.pond.sub.org ([78.46.104.156]:50625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sn2Uc-0003Nj-Vs for qemu-devel@nongnu.org; Fri, 06 Jul 2012 02:58:19 -0400 Received: from blackfin.pond.sub.org (p5B32A0DA.dip.t-dialin.net [91.50.160.218]) by oxygen.pond.sub.org (Postfix) with ESMTPA id EA72BA5A68; Fri, 6 Jul 2012 08:58:15 +0200 (CEST) Received: by blackfin.pond.sub.org (Postfix, from userid 500) id 80CB8600AF; Fri, 6 Jul 2012 08:58:11 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Fri, 6 Jul 2012 08:57:56 +0200 Message-Id: <1341557890-17464-19-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.7.6.5 In-Reply-To: <1341557890-17464-1-git-send-email-armbru@redhat.com> References: <1341557890-17464-1-git-send-email-armbru@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 78.46.104.156 Cc: kwolf@redhat.com, blauwirbel@gmail.com, stefanha@linux.vnet.ibm.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH 18/32] hd-geometry: Switch to uint32_t to match BlockConf 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 Best to use the same type, to avoid unwanted truncation or sign extension. BlockConf can't use plain int for cyls, heads and secs, because integer properties require an exact width. Signed-off-by: Markus Armbruster --- hw/block-common.h | 2 +- hw/hd-geometry.c | 4 ++-- hw/ide/core.c | 2 +- hw/scsi-disk.c | 2 +- hw/virtio-blk.c | 2 +- trace-events | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/block-common.h b/hw/block-common.h index bba817a..2f65186 100644 --- a/hw/block-common.h +++ b/hw/block-common.h @@ -16,7 +16,7 @@ /* Hard disk geometry */ void hd_geometry_guess(BlockDriverState *bs, - int *pcyls, int *pheads, int *psecs, + uint32_t *pcyls, uint32_t *pheads, uint32_t *psecs, int *ptrans); #endif diff --git a/hw/hd-geometry.c b/hw/hd-geometry.c index 4d746b7..7626cbb 100644 --- a/hw/hd-geometry.c +++ b/hw/hd-geometry.c @@ -98,7 +98,7 @@ static int guess_disk_lchs(BlockDriverState *bs, } static void guess_chs_for_size(BlockDriverState *bs, - int *pcyls, int *pheads, int *psecs) + uint32_t *pcyls, uint32_t *pheads, uint32_t *psecs) { uint64_t nb_sectors; int cylinders; @@ -117,7 +117,7 @@ static void guess_chs_for_size(BlockDriverState *bs, } void hd_geometry_guess(BlockDriverState *bs, - int *pcyls, int *pheads, int *psecs, + uint32_t *pcyls, uint32_t *pheads, uint32_t *psecs, int *ptrans) { int cylinders, heads, secs, translation; diff --git a/hw/ide/core.c b/hw/ide/core.c index 7f5ad07..f1966e3 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -1927,7 +1927,7 @@ int ide_init_drive(IDEState *s, BlockDriverState *bs, IDEDriveKind kind, const char *version, const char *serial, const char *model, uint64_t wwn) { - int cylinders, heads, secs; + uint32_t cylinders, heads, secs; uint64_t nb_sectors; s->bs = bs; diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index ecc9d05..bb758f2 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -927,7 +927,7 @@ static int mode_sense_page(SCSIDiskState *s, int page, uint8_t **p_outbuf, }; BlockDriverState *bdrv = s->qdev.conf.bs; - int cylinders, heads, secs; + uint32_t cylinders, heads, secs; uint8_t *p = *p_outbuf; if ((mode_sense_valid[page] & (1 << s->qdev.type)) == 0) { diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index d2709a7..4344e28 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -590,7 +590,7 @@ static const BlockDevOps virtio_block_ops = { VirtIODevice *virtio_blk_init(DeviceState *dev, VirtIOBlkConf *blk) { VirtIOBlock *s; - int cylinders, heads, secs; + uint32_t cylinders, heads, secs; static int virtio_blk_id; DriveInfo *dinfo; diff --git a/trace-events b/trace-events index cb1df3e..b0440ae 100644 --- a/trace-events +++ b/trace-events @@ -143,7 +143,7 @@ ecc_diag_mem_readb(uint64_t addr, uint32_t ret) "Read diagnostic %"PRId64"= %02x # hw/hd-geometry.c hd_geometry_lchs_guess(void *bs, int cyls, int heads, int secs) "bs %p LCHS %d %d %d" -hd_geometry_guess(void *bs, int cyls, int heads, int secs, int trans) "bs %p CHS %d %d %d trans %d" +hd_geometry_guess(void *bs, uint32_t cyls, uint32_t heads, uint32_t secs, int trans) "bs %p CHS %u %u %u trans %d" # hw/jazz-led.c jazz_led_read(uint64_t addr, uint8_t val) "read addr=0x%"PRIx64": 0x%x"