From patchwork Wed Jan 16 13:50:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 212545 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 856502C0085 for ; Thu, 17 Jan 2013 01:54:45 +1100 (EST) Received: from localhost ([::1]:55803 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvTOv-0003q6-1j for incoming@patchwork.ozlabs.org; Wed, 16 Jan 2013 08:51:33 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvTO8-0002Gb-3H for qemu-devel@nongnu.org; Wed, 16 Jan 2013 08:50:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvTO4-0007Ld-93 for qemu-devel@nongnu.org; Wed, 16 Jan 2013 08:50:44 -0500 Received: from oxygen.pond.sub.org ([2a01:4f8:121:10e4::3]:41553) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvTO4-0007LJ-39 for qemu-devel@nongnu.org; Wed, 16 Jan 2013 08:50:40 -0500 Received: from blackfin.pond.sub.org (p5B32B5E9.dip.t-dialin.net [91.50.181.233]) by oxygen.pond.sub.org (Postfix) with ESMTPA id 97A36A2468; Wed, 16 Jan 2013 14:50:37 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 86B3F200B0; Wed, 16 Jan 2013 14:50:30 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 16 Jan 2013 14:50:29 +0100 Message-Id: <1358344229-18006-9-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1358344229-18006-1-git-send-email-armbru@redhat.com> References: <1358344229-18006-1-git-send-email-armbru@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:4f8:121:10e4::3 Cc: blauwirbel@gmail.com, aliguori@us.ibm.com, gleb@redhat.com Subject: [Qemu-devel] [PATCH 8/8] vl: Use size_t for sizes in get_boot_devices_list() 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 Code mixes uint32_t, int and size_t. Very unlikely to go wrong in practice, but clean it up anyway. Signed-off-by: Markus Armbruster --- hw/fw_cfg.c | 2 +- include/sysemu/sysemu.h | 2 +- vl.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c index 699383c..3b31d77 100644 --- a/hw/fw_cfg.c +++ b/hw/fw_cfg.c @@ -471,7 +471,7 @@ void fw_cfg_add_file(FWCfgState *s, const char *filename, static void fw_cfg_machine_ready(struct Notifier *n, void *data) { - uint32_t len; + size_t len; FWCfgState *s = container_of(n, FWCfgState, machine_ready); char *bootindex = get_boot_devices_list(&len); diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index c07d4ee..6047ef3 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -179,7 +179,7 @@ void register_devices(void); void add_boot_device_path(int32_t bootindex, DeviceState *dev, const char *suffix); -char *get_boot_devices_list(uint32_t *size); +char *get_boot_devices_list(size_t *size); bool usb_enabled(bool default_usb); diff --git a/vl.c b/vl.c index 15e0280..395c85b 100644 --- a/vl.c +++ b/vl.c @@ -1198,15 +1198,15 @@ void add_boot_device_path(int32_t bootindex, DeviceState *dev, * memory pointed by "size" is assigned total length of the array in bytes * */ -char *get_boot_devices_list(uint32_t *size) +char *get_boot_devices_list(size_t *size) { FWBootEntry *i; - uint32_t total = 0; + size_t total = 0; char *list = NULL; QTAILQ_FOREACH(i, &fw_boot_order, link) { char *devpath = NULL, *bootpath; - int len; + size_t len; if (i->dev) { devpath = qdev_get_fw_dev_path(i->dev);