From patchwork Mon Jul 2 18:06:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 168621 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 E1A1F2C00A5 for ; Tue, 3 Jul 2012 04:06:05 +1000 (EST) Received: from localhost ([::1]:42402 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sll0d-0000Kp-Nv for incoming@patchwork.ozlabs.org; Mon, 02 Jul 2012 14:06:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sll0W-0000Kf-EX for qemu-devel@nongnu.org; Mon, 02 Jul 2012 14:05:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sll0U-0001mH-Ms for qemu-devel@nongnu.org; Mon, 02 Jul 2012 14:05:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sll0U-0001lw-Eg for qemu-devel@nongnu.org; Mon, 02 Jul 2012 14:05:54 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q62I5mrl004048 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 2 Jul 2012 14:05:49 -0400 Received: from blackpad.lan.raisama.net (vpn1-4-141.gru2.redhat.com [10.97.4.141]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q62I5luM006757; Mon, 2 Jul 2012 14:05:48 -0400 Received: by blackpad.lan.raisama.net (Postfix, from userid 500) id 9758A2005BC; Mon, 2 Jul 2012 15:06:40 -0300 (BRT) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Mon, 2 Jul 2012 15:06:33 -0300 Message-Id: <1341252398-12268-2-git-send-email-ehabkost@redhat.com> In-Reply-To: <1341252398-12268-1-git-send-email-ehabkost@redhat.com> References: <1341252398-12268-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Andrea Arcangeli , Andre Przywara , kvm@vger.kernel.org, Blue Swirl , Bharata B Rao , Bill Gray Subject: [Qemu-devel] [PATCH 1/6] file_ram_alloc(): coding style fixes 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 Cc: Blue Swirl Signed-off-by: Eduardo Habkost Acked-by: Blue Swirl --- exec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index 8244d54..c8bfd27 100644 --- a/exec.c +++ b/exec.c @@ -2392,7 +2392,7 @@ static void *file_ram_alloc(RAMBlock *block, unlink(filename); free(filename); - memory = (memory+hpagesize-1) & ~(hpagesize-1); + memory = (memory + hpagesize - 1) & ~(hpagesize - 1); /* * ftruncate is not supported by hugetlbfs in older @@ -2400,8 +2400,9 @@ static void *file_ram_alloc(RAMBlock *block, * If anything goes wrong with it under other filesystems, * mmap will fail. */ - if (ftruncate(fd, memory)) + if (ftruncate(fd, memory)) { perror("ftruncate"); + } #ifdef MAP_POPULATE /* NB: MAP_POPULATE won't exhaustively alloc all phys pages in the case