From patchwork Thu Jun 11 08:44:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Auger Eric X-Patchwork-Id: 49735 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4E53620C81 for ; Thu, 11 Jun 2015 08:45:29 +0000 (UTC) Received: by wgez8 with SMTP id z8sf132631wge.2 for ; Thu, 11 Jun 2015 01:45:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=rBr805rr3Azj8Yt6CH+0tMMoERpekUv/+kNd2II4/V0=; b=bkLeCTcihoJBKLUqTKGupgaVyZ9jHC40aNYzU9LhpKxGHFnZQK0W4uepsGbbDGfOE+ a5LRuTeO2nQtbzpxvld/PA1EW1SoBaZByQtZG4VWyl+UFoxZR0a86Q2tDZe79xKUvMrW m222DFvgUTqYWgvNGzmCHJPyYR7SEfT68YZHNkEhn1TFjWXw7D0nsTFiCdhzBcAiEy8y LOvwrBspKRO3pIBRJgYJKV14xSGrnYcz9CvIOwjbtovjFfdLu4KGToJUy/gNLbHQwPgk ZYMCU1RsaiVINuk5GhpfevbIjTxta2JHpVtR9eccb0Fj44J1acvNbxhwjAktdsndp+pw KKIQ== X-Gm-Message-State: ALoCoQkjairPVIece5MN/tMkUc5baeCL2X/ePtr7rI3kXG/DG4XJBVlYX2UaW7fceouQyXNSGDmi X-Received: by 10.180.35.164 with SMTP id i4mr354759wij.0.1434012328601; Thu, 11 Jun 2015 01:45:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.133 with SMTP id y5ls377969laj.19.gmail; Thu, 11 Jun 2015 01:45:28 -0700 (PDT) X-Received: by 10.112.154.71 with SMTP id vm7mr8481184lbb.96.1434012328261; Thu, 11 Jun 2015 01:45:28 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id t10si12782laa.17.2015.06.11.01.45.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2015 01:45:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbqq2 with SMTP id qq2so316920lbb.3 for ; Thu, 11 Jun 2015 01:45:28 -0700 (PDT) X-Received: by 10.112.97.194 with SMTP id ec2mr8668493lbb.88.1434012328119; Thu, 11 Jun 2015 01:45:28 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp3878968lbb; Thu, 11 Jun 2015 01:45:27 -0700 (PDT) X-Received: by 10.140.48.129 with SMTP id o1mr9643074qga.21.1434012326716; Thu, 11 Jun 2015 01:45:26 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 184si2718155qhs.55.2015.06.11.01.45.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 11 Jun 2015 01:45:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:43817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2y73-0006rF-U1 for patch@linaro.org; Thu, 11 Jun 2015 04:45:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2y6c-0006Vx-Ri for qemu-devel@nongnu.org; Thu, 11 Jun 2015 04:44:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2y6Z-0006Gq-BB for qemu-devel@nongnu.org; Thu, 11 Jun 2015 04:44:58 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:35611) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2y6Z-0006GU-4m for qemu-devel@nongnu.org; Thu, 11 Jun 2015 04:44:55 -0400 Received: by wiga1 with SMTP id a1so68985585wig.0 for ; Thu, 11 Jun 2015 01:44:54 -0700 (PDT) X-Received: by 10.180.76.8 with SMTP id g8mr27160958wiw.79.1434012294495; Thu, 11 Jun 2015 01:44:54 -0700 (PDT) Received: from midway01-04-00.lavalab ([81.128.185.50]) by mx.google.com with ESMTPSA id ei8sm18308803wjd.32.2015.06.11.01.44.53 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Jun 2015 01:44:53 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, qemu-devel@nongnu.org, alex.williamson@redhat.com, peter.maydell@linaro.org, arei.gonglei@huawei.com Date: Thu, 11 Jun 2015 09:44:40 +0100 Message-Id: <1434012280-23556-1-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.8.3.2 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.212.178 Subject: [Qemu-devel] [PATCH v2] hw/vfio/platform: replace g_malloc0_n by g_new0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: eric.auger@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 g_malloc0_n() is introduced since glib-2.24 while QEMU currently requires glib-2.22. This may cause a link error on some distributions. Signed-off-by: Eric Auger --- v1 -> v2: - replace g_malloc0 by g_new0 --- hw/vfio/platform.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 35266a8..9382bb7 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -346,8 +346,7 @@ static int vfio_populate_device(VFIODevice *vbasedev) return ret; } - vdev->regions = g_malloc0_n(vbasedev->num_regions, - sizeof(VFIORegion *)); + vdev->regions = g_new0(VFIORegion *, vbasedev->num_regions); for (i = 0; i < vbasedev->num_regions; i++) { struct vfio_region_info reg_info = { .argsz = sizeof(reg_info) };