From patchwork Tue Apr 28 14:09:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 6289711 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B0A81BEEE1 for ; Tue, 28 Apr 2015 14:06:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F3D1120383 for ; Tue, 28 Apr 2015 14:06:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C4242203A0 for ; Tue, 28 Apr 2015 14:06:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2ABB36E59C; Tue, 28 Apr 2015 07:06:46 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by gabe.freedesktop.org (Postfix) with ESMTP id 55A416E59C for ; Tue, 28 Apr 2015 07:06:44 -0700 (PDT) Received: by wgin8 with SMTP id n8so152692769wgi.0 for ; Tue, 28 Apr 2015 07:06:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6RBLcBr43TkVj3K3yqCZ/iKgU7Ct97d0znvb+UxTDVs=; b=wuG461N7A513/ARt3wRso08Q0bpbujWCkE+EeF4Iiaksd4TgggfKroA7bnaBXvH7cc g03yl4O3/39sB0VtS7XT975d2W6Brr+2Vw4ekz1Wy3apOAmmha2hjsjQExPMsUzlTAdy gD2zlqPPM2MhBY3CphY9tHQ7IqGB+KVHOwZOxywH/E9X+I6dYxVmY61qOmcqdmrJ6fBy T1Sw03Ml3xept19RrJGyS6GuCgOSFOgXX0HGOImBDKCPh9RFgpvT05ejKnlqoFCRryCS Ui5f7wYJPHVvI+OV/nsLg0gPLUroYQajMX72RP6iOLnYWAVUHMbv0A62ObINLWbN0Rkm PCzg== X-Received: by 10.194.104.71 with SMTP id gc7mr31427900wjb.114.1430230003346; Tue, 28 Apr 2015 07:06:43 -0700 (PDT) Received: from arch-x220.localdomain (cpc12-croy20-2-0-cust52.croy.cable.virginm.net. [82.44.54.53]) by mx.google.com with ESMTPSA id ju2sm16583819wid.12.2015.04.28.07.06.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Apr 2015 07:06:42 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 3/3] xf86drm: simplify drmMalloc/drmFree Date: Tue, 28 Apr 2015 15:09:59 +0100 Message-Id: <1430230199-3562-3-git-send-email-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1430230199-3562-1-git-send-email-emil.l.velikov@gmail.com> References: <1430230199-3562-1-git-send-email-emil.l.velikov@gmail.com> Cc: emil.l.velikov@gmail.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Emil Velikov Reviewed-by: Alex Deucher --- xf86drm.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/xf86drm.c b/xf86drm.c index f7c45f8..9cd0b02 100644 --- a/xf86drm.c +++ b/xf86drm.c @@ -140,16 +140,12 @@ void *drmGetHashTable(void) void *drmMalloc(int size) { - void *pt; - if ((pt = malloc(size))) - memset(pt, 0, size); - return pt; + return calloc(1, size); } void drmFree(void *pt) { - if (pt) - free(pt); + free(pt); } /**