From patchwork Thu Aug 7 13:09:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 4691141 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6EF4F9F373 for ; Thu, 7 Aug 2014 13:09:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 79FA7201DD for ; Thu, 7 Aug 2014 13:09:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 41ED7201DC for ; Thu, 7 Aug 2014 13:09:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 982DE89F71; Thu, 7 Aug 2014 06:09:24 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yk0-f182.google.com (mail-yk0-f182.google.com [209.85.160.182]) by gabe.freedesktop.org (Postfix) with ESMTP id D55D989F71 for ; Thu, 7 Aug 2014 06:09:23 -0700 (PDT) Received: by mail-yk0-f182.google.com with SMTP id q9so2746518ykb.27 for ; Thu, 07 Aug 2014 06:09:23 -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; bh=t2JjD+RM+Oq7/jk/QiIj6vJ/MAFpI+MPS6EMn7aErhQ=; b=IB+1YFQ0Y+MKWr6cFII3nlOKkTO9hW0Qgut6C+bFu2Sa64XOgpNSJPY9opYzrEmof/ VzF/CoSkfPSiq33v3D8M6jnGl4pPOM3sxH1iiLpJ6VnJ664dFEmNVPTYZNrmKFdBVq1r Q81GAMUZA1nxyfFVo/ryrrBLQi+1YQRZ7tuS4Emgeu5dPSGebYgmdFqGkfzr+BHk3uZG dVJ7SgH0fNfUu21+VYTlVG3LyOuGw/482UO7P1e2u4vP50tLwOBOwSs1DneaMcpWW9qb 7sP+15zv1hlb/e0/UBxacW4SfKciXzjX7QWSpj351Xop/eTkaWHrvF5LSDZeVXI93xsP MreQ== X-Received: by 10.236.223.36 with SMTP id u34mr4637948yhp.79.1407416963290; Thu, 07 Aug 2014 06:09:23 -0700 (PDT) Received: from localhost.localdomain ([177.156.106.184]) by mx.google.com with ESMTPSA id u23sm7515674yhg.28.2014.08.07.06.09.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Aug 2014 06:09:22 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Thu, 7 Aug 2014 10:09:02 -0300 Message-Id: <1407416947-2282-1-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 2.0.1 Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 1/6] igt_kms: don't get drmModeRes just to free it later X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Paulo Zanoni Stress testing malloc is not our goal :) Signed-off-by: Paulo Zanoni --- lib/igt_kms.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 740b5dd..8ab729b 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -276,21 +276,11 @@ void igt_set_vt_graphics_mode(void) int kmstest_get_connector_default_mode(int drm_fd, drmModeConnector *connector, drmModeModeInfo *mode) { - drmModeRes *resources; int i; - resources = drmModeGetResources(drm_fd); - if (!resources) { - perror("drmModeGetResources failed"); - - return -1; - } - if (!connector->count_modes) { fprintf(stderr, "no modes for connector %d\n", connector->connector_id); - drmModeFreeResources(resources); - return -1; } @@ -303,8 +293,6 @@ int kmstest_get_connector_default_mode(int drm_fd, drmModeConnector *connector, } } - drmModeFreeResources(resources); - return 0; }