From patchwork Fri Feb 15 15:49:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 220763 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 8A96E2C0089 for ; Sat, 16 Feb 2013 02:49:45 +1100 (EST) Received: from localhost ([::1]:42280 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6NXi-0000H8-Sz for incoming@patchwork.ozlabs.org; Fri, 15 Feb 2013 10:49:42 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6NXW-0000H0-QU for qemu-devel@nongnu.org; Fri, 15 Feb 2013 10:49:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U6NXN-0007t9-N4 for qemu-devel@nongnu.org; Fri, 15 Feb 2013 10:49:30 -0500 Received: from cantor2.suse.de ([195.135.220.15]:60730 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6NXN-0007sy-Gu; Fri, 15 Feb 2013 10:49:21 -0500 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B004CA398D; Fri, 15 Feb 2013 16:49:19 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Date: Fri, 15 Feb 2013 16:49:11 +0100 Message-Id: <1360943351-24806-1-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: Alexander Graf , "open list:sPAPR" , =?UTF-8?q?Andreas=20F=C3=A4rber?= , David Gibson Subject: [Qemu-devel] [PATCH qom-cpu-next] spapr_hcall: Replace open-coded CPU loop with qemu_get_cpu() 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 The helper functions all access ppc-specific fields only so don't bother to change arguments to PowerPCCPU and use env_ptr instead. No functional change. Signed-off-by: Andreas Färber Acked-by: Alexander Graf Acked-by: David Gibson --- hw/spapr_hcall.c | 11 +++-------- 1 Datei geändert, 3 Zeilen hinzugefügt(+), 8 Zeilen entfernt(-) diff --git a/hw/spapr_hcall.c b/hw/spapr_hcall.c index af1db6e..7b89594 100644 --- a/hw/spapr_hcall.c +++ b/hw/spapr_hcall.c @@ -469,16 +469,11 @@ static target_ulong h_register_vpa(PowerPCCPU *cpu, sPAPREnvironment *spapr, CPUPPCState *tenv; CPUState *tcpu; - for (tenv = first_cpu; tenv; tenv = tenv->next_cpu) { - tcpu = CPU(ppc_env_get_cpu(tenv)); - if (tcpu->cpu_index == procno) { - break; - } - } - - if (!tenv) { + tcpu = qemu_get_cpu(procno); + if (!tcpu) { return H_PARAMETER; } + tenv = tcpu->env_ptr; switch (flags) { case FLAGS_REGISTER_VPA: