From patchwork Mon Jul 25 15:03:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emilio Cota X-Patchwork-Id: 9245891 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E77DF607D3 for ; Mon, 25 Jul 2016 15:06:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D96F625250 for ; Mon, 25 Jul 2016 15:06:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDC7626E5D; Mon, 25 Jul 2016 15:06:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 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 mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A5A3125250 for ; Mon, 25 Jul 2016 15:06:16 +0000 (UTC) Received: from localhost ([::1]:32868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRhSR-0008G2-OE for patchwork-qemu-devel@patchwork.kernel.org; Mon, 25 Jul 2016 11:06:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58583) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRhQk-0007DP-Iv for qemu-devel@nongnu.org; Mon, 25 Jul 2016 11:04:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRhQf-0000ud-Tz for qemu-devel@nongnu.org; Mon, 25 Jul 2016 11:04:29 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:51028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRhQd-0000s4-Lv for qemu-devel@nongnu.org; Mon, 25 Jul 2016 11:04:25 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 381B520744; Mon, 25 Jul 2016 11:04:13 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Mon, 25 Jul 2016 11:04:13 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-sasl-enc:x-sasl-enc; s=mesmtp; bh=by7vQ3XfudiZ/paih5SnEWEZijI =; b=QSJy2Pa42Rk6ZMGQENPLLLsBFBRA3LkXirAuxG7Iwr1ajaO1YyjqP/N9/9y W4zt6YBR+MCVCdWNhBWi2ZGvss2g6JSiZIH3+d8OanHdXgkHwCWWM/86jdSvOXqJ W6X9jpz3826OPJvigjyMFghwySIWw+yndm8dzQmchNqc89dQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=by7v Q3XfudiZ/paih5SnEWEZijI=; b=RNyWC3kWw6wFrJIUHlNztIIjECQdHxWkl08K pQH6B6FHKZhEDxqgd0iaTsH/ru2vw3feVa/pDmbuQlfEKLB0i43Mnmyp7W60eqIX fbZwZ4WtyhW1dgFrOj0UjBaL0UwUs2KG6x/QwUAn2ZQYkwzNY1C0rs2ESBfAMl5A KyYcf2I= X-Sasl-enc: i3wM6k98zJzXuaEOlRaOuIEMQyfBl3grzXLrIFdeTnTA 1469459052 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id C4DD7CCDCE; Mon, 25 Jul 2016 11:04:12 -0400 (EDT) From: "Emilio G. Cota" To: QEMU Developers Date: Mon, 25 Jul 2016 11:03:44 -0400 Message-Id: <1469459025-23606-3-git-send-email-cota@braap.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1469459025-23606-1-git-send-email-cota@braap.org> References: <1469459025-23606-1-git-send-email-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.29 Subject: [Qemu-devel] [PATCH 2/3] qdist: use g_realloc_n instead of g_realloc X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Paolo Bonzini , Changlong Xie , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP While at it, remove the unnecessary parentheses around dist->size. Signed-off-by: Emilio G. Cota Reviewed-by: Marc-André Lureau --- util/qdist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/qdist.c b/util/qdist.c index eb2236c..cc31140 100644 --- a/util/qdist.c +++ b/util/qdist.c @@ -62,8 +62,8 @@ void qdist_add(struct qdist *dist, double x, long count) if (unlikely(dist->n == dist->size)) { dist->size *= 2; - dist->entries = g_realloc(dist->entries, - sizeof(*dist->entries) * (dist->size)); + dist->entries = g_realloc_n(dist->entries, dist->size, + sizeof(*dist->entries)); } dist->n++; entry = &dist->entries[dist->n - 1];