From patchwork Mon Jul 1 11:40:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 18193 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-fa0-f71.google.com (mail-fa0-f71.google.com [209.85.161.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 191CC25E04 for ; Mon, 1 Jul 2013 11:40:24 +0000 (UTC) Received: by mail-fa0-f71.google.com with SMTP id v1sf5760830fav.6 for ; Mon, 01 Jul 2013 04:40:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=rKkj8h9o1/kTN7XtgB6LpE4wnZmpDte428lYWZSfFrg=; b=c65As2U9+r37GrEfbtZn+SvAYrlPfSDWEwrudwJ8o+A2hUGbm4MCLc37bZ0B27Liio /Rd1gDulN84eV6raLK9lFPHKkpWWu22hWFAeQlll2iIwnfKYB5lHzIVRfpHL2nnOB3pZ ESyud4ElGS8cyH3aiuWy/R99IVKPM6qTBAN6HMNr4H5JJ7VNsGJTLwcj9Y55QUeUtG9k REhlQmB5B0WXm1gZAmUoZgghH5S26HrfxdMDnpLQD4p9N0wmghmPdEjDPcB8ls1pxJIq 94z2dweWz8OD4njBf3TR0LiRQcLFGQbwxJnfIaAjgsE8ZObWBVPoQGxg8+MuJ+kgSgtz BmHg== X-Received: by 10.180.207.44 with SMTP id lt12mr8779662wic.5.1372678823581; Mon, 01 Jul 2013 04:40:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.95.198 with SMTP id dm6ls706330wib.28.gmail; Mon, 01 Jul 2013 04:40:23 -0700 (PDT) X-Received: by 10.180.76.206 with SMTP id m14mr11628220wiw.38.1372678823096; Mon, 01 Jul 2013 04:40:23 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id ib1si6344692wjb.48.2013.07.01.04.40.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 01 Jul 2013 04:40:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id c13so3592947vea.21 for ; Mon, 01 Jul 2013 04:40:22 -0700 (PDT) X-Received: by 10.52.77.5 with SMTP id o5mr7911680vdw.46.1372678822005; Mon, 01 Jul 2013 04:40:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp277206veb; Mon, 1 Jul 2013 04:40:21 -0700 (PDT) X-Received: by 10.180.185.84 with SMTP id fa20mr11842127wic.49.1372678820766; Mon, 01 Jul 2013 04:40:20 -0700 (PDT) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id k13si3050888wiv.33.2013.07.01.04.40.20 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 01 Jul 2013 04:40:20 -0700 (PDT) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1UtcSx-0002Fi-1m; Mon, 01 Jul 2013 12:40:19 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH] target-arm: Avoid g_hash_table_get_keys() Date: Mon, 1 Jul 2013 12:40:19 +0100 Message-Id: <1372678819-8633-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQmmdyrOodbOJl7LVS6SUMhpM42AT9j827RnvbuJFOcRaPMvQzgeml+cO7hkeZ8Wz3TR91K3 X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , g_hash_table_get_keys() was only introduced in glib 2.14, and we're still targeting a minimum version of 2.12. Rewrite the offending code (introduced in commit 721fae1) to use g_hash_table_foreach() to build the list of keys. Signed-off-by: Peter Maydell Tested-by: Laurent Desnogues Tested-by: Peter Crosthwaite --- target-arm/helper.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 5f639fd..7cd3be8 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -222,15 +222,23 @@ static gint cpreg_key_compare(gconstpointer a, gconstpointer b) return aidx - bidx; } +static void cpreg_make_keylist(gpointer key, gpointer value, gpointer udata) +{ + GList **plist = udata; + + *plist = g_list_prepend(*plist, key); +} + void init_cpreg_list(ARMCPU *cpu) { /* Initialise the cpreg_tuples[] array based on the cp_regs hash. * Note that we require cpreg_tuples[] to be sorted by key ID. */ - GList *keys; + GList *keys = NULL; int arraylen; - keys = g_hash_table_get_keys(cpu->cp_regs); + g_hash_table_foreach(cpu->cp_regs, cpreg_make_keylist, &keys); + keys = g_list_sort(keys, cpreg_key_compare); cpu->cpreg_array_len = 0;