From patchwork Mon Sep 7 14:48:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 515195 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 82CB61401CB for ; Tue, 8 Sep 2015 01:03:07 +1000 (AEST) Received: from localhost ([::1]:57150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxwn-0000EG-Qj for incoming@patchwork.ozlabs.org; Mon, 07 Sep 2015 11:03:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxjA-0006E1-GT for qemu-devel@nongnu.org; Mon, 07 Sep 2015 10:49:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYxj6-0002Gr-GE for qemu-devel@nongnu.org; Mon, 07 Sep 2015 10:49:00 -0400 Received: from e06smtp16.uk.ibm.com ([195.75.94.112]:54173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYxj5-0002GO-UK for qemu-devel@nongnu.org; Mon, 07 Sep 2015 10:48:56 -0400 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 7 Sep 2015 15:48:54 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp16.uk.ibm.com (192.168.101.146) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 7 Sep 2015 15:48:51 +0100 X-Helo: d06dlp02.portsmouth.uk.ibm.com X-MailFrom: cornelia.huck@de.ibm.com X-RcptTo: qemu-devel@nongnu.org Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 8AF802190067 for ; Mon, 7 Sep 2015 15:48:23 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t87EmpiF43581556 for ; Mon, 7 Sep 2015 14:48:51 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t87EmoPI030863 for ; Mon, 7 Sep 2015 08:48:51 -0600 Received: from gondolin.boeblingen.de.ibm.com (dyn-9-152-224-121.boeblingen.de.ibm.com [9.152.224.121]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t87Eme0e030181 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 7 Sep 2015 08:48:49 -0600 From: Cornelia Huck To: peter.maydell@linaro.org Date: Mon, 7 Sep 2015 16:48:37 +0200 Message-Id: <1441637317-14471-24-git-send-email-cornelia.huck@de.ibm.com> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1441637317-14471-1-git-send-email-cornelia.huck@de.ibm.com> References: <1441637317-14471-1-git-send-email-cornelia.huck@de.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15090714-0025-0000-0000-000006C240DE X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.112 Cc: borntraeger@de.ibm.com, qemu-devel@nongnu.org, agraf@suse.de, David Hildenbrand , jfrei@linux.vnet.ibm.com, Cornelia Huck Subject: [Qemu-devel] [PULL 23/23] s390/sclp: simplify calculation of rnmax 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 From: David Hildenbrand rnmax can be directly calculated using machine->maxram_size. Reviewed-by: Matthew Rosato Signed-off-by: David Hildenbrand Signed-off-by: Cornelia Huck --- hw/s390x/sclp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index 0a7f4dd..fd277e1 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -56,7 +56,6 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb) read_info->facilities = cpu_to_be64(SCLP_HAS_CPU_INFO | SCLP_HAS_PCI_RECONFIG); - rnmax = ram_size >> sclp->increment_size; /* Memory Hotplug is only supported for the ccw machine type */ if (mhd) { mhd->standby_subregion_size = MEM_SECTION_SIZE; @@ -84,8 +83,6 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb) } mhd->padded_ram_size = ram_size + mhd->pad_size; mhd->rzm = 1 << mhd->increment_size; - rnmax = ((ram_size + mhd->standby_mem_size + mhd->pad_size) - >> mhd->increment_size); read_info->facilities |= cpu_to_be64(SCLP_FC_ASSIGN_ATTACH_READ_STOR); } @@ -98,6 +95,7 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb) read_info->rnsize2 = cpu_to_be32(rnsize); } + rnmax = machine->maxram_size >> sclp->increment_size; if (rnmax < 0x10000) { read_info->rnmax = cpu_to_be16(rnmax); } else {