From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWN36-00078n-UN for qemu-devel@nongnu.org; Mon, 31 Aug 2015 07:14:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWN33-0006Y2-2f for qemu-devel@nongnu.org; Mon, 31 Aug 2015 07:14:52 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:36368) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWN32-0006Xb-Fr for qemu-devel@nongnu.org; Mon, 31 Aug 2015 07:14:48 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 31 Aug 2015 12:14:42 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 295B917D805A for ; Mon, 31 Aug 2015 12:16:14 +0100 (BST) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t7VBETkF18874490 for ; Mon, 31 Aug 2015 11:14:32 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t7VBEKpK022529 for ; Mon, 31 Aug 2015 05:14:20 -0600 From: Cornelia Huck Date: Mon, 31 Aug 2015 13:14:03 +0200 Message-Id: <1441019643-10677-24-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1441019643-10677-1-git-send-email-cornelia.huck@de.ibm.com> References: <1441019643-10677-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PATCH 23/23] s390/sclp: simplify calculation of rnmax List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Cornelia Huck , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, agraf@suse.de, David Hildenbrand 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 { -- 2.5.1