From patchwork Fri Aug 29 10:12:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Herrmann X-Patchwork-Id: 4809941 Return-Path: X-Original-To: patchwork-dri-devel@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 61C009F37E for ; Fri, 29 Aug 2014 10:13:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8399620127 for ; Fri, 29 Aug 2014 10:13:52 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B21C520123 for ; Fri, 29 Aug 2014 10:13:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C32676E68D; Fri, 29 Aug 2014 03:13:50 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 267C26E68D for ; Fri, 29 Aug 2014 03:13:48 -0700 (PDT) Received: by mail-wg0-f49.google.com with SMTP id y10so1936891wgg.8 for ; Fri, 29 Aug 2014 03:13:47 -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=eqER5qrelRCIf7tQ5Jelz3OgV8I9O7Xocv7lwS0zgpo=; b=A5ivUmD5SlmZHOkbOhPG2B4xvTWKtTpxgmrgy3QvEBOGFUfACRlHzccNgDzvXU2Rom QCpyXO2lHRKRCV39SRY7y/8U3WGVcJMSEKrjvHKETdX3nvxfwnnWMMP4QUaEr/H+4oj2 yPSh2bWCt+z6OtzGwzocEzqy2bAr2mbNXo6iulG/Wy1yrtGF50j4a+72l0wGw4Ga4USR R6RhLCl8M/1fC3jiHlUyq30xGqIV/XNri2MB9elQZXFDRcohXOXC7VeVZur7IIdpDToG VuwW2ZWJD2SWabhYtYCUsZAILpMO2RhvQu/iu0jWA+hpVGVJPEVH5NRCfaf6xUHtDhkg YdLA== X-Received: by 10.180.210.231 with SMTP id mx7mr2816212wic.42.1409307227465; Fri, 29 Aug 2014 03:13:47 -0700 (PDT) Received: from david-tp.localdomain (stgt-4d02e0c1.pool.mediaWays.net. [77.2.224.193]) by mx.google.com with ESMTPSA id la2sm17479347wjb.5.2014.08.29.03.13.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Aug 2014 03:13:46 -0700 (PDT) From: David Herrmann To: dri-devel@lists.freedesktop.org Subject: [PATCH 16/20] drm: drop unused drm_master->unique_size Date: Fri, 29 Aug 2014 12:12:42 +0200 Message-Id: <1409307166-12396-17-git-send-email-dh.herrmann@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1409307166-12396-1-git-send-email-dh.herrmann@gmail.com> References: <1409307166-12396-1-git-send-email-dh.herrmann@gmail.com> Cc: Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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, 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 This field is unused and there is really no reason to optimize unique-allocations. Drop it. Signed-off-by: David Herrmann Reviewed-by: Thierry Reding Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_ioctl.c | 1 - drivers/gpu/drm/drm_pci.c | 4 +--- drivers/gpu/drm/drm_platform.c | 1 - include/drm/drmP.h | 2 -- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index aa1ac79..cb6b54a 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -189,7 +189,6 @@ drm_unset_busid(struct drm_device *dev, kfree(master->unique); master->unique = NULL; master->unique_len = 0; - master->unique_size = 0; } /** diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 8efea6b..e266927 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -138,7 +138,6 @@ static int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master) return -ENOMEM; master->unique_len = strlen(master->unique); - master->unique_size = master->unique_len + 1; return 0; } @@ -149,8 +148,7 @@ int drm_pci_set_unique(struct drm_device *dev, int domain, bus, slot, func, ret; master->unique_len = u->unique_len; - master->unique_size = u->unique_len + 1; - master->unique = kmalloc(master->unique_size, GFP_KERNEL); + master->unique = kmalloc(master->unique_len + 1, GFP_KERNEL); if (!master->unique) { ret = -ENOMEM; goto err; diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c index 0c09ddd..f197a2b 100644 --- a/drivers/gpu/drm/drm_platform.c +++ b/drivers/gpu/drm/drm_platform.c @@ -82,7 +82,6 @@ static int drm_platform_set_busid(struct drm_device *dev, struct drm_master *mas return -ENOMEM; master->unique_len = strlen(master->unique); - master->unique_size = master->unique_len; return 0; } diff --git a/include/drm/drmP.h b/include/drm/drmP.h index a8b24fc..98b1eaf 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -574,7 +574,6 @@ struct drm_gem_object { * @minor: Link back to minor char device we are master for. Immutable. * @unique: Unique identifier: e.g. busid. Protected by drm_global_mutex. * @unique_len: Length of unique field. Protected by drm_global_mutex. - * @unique_size: Amount allocated. Protected by drm_global_mutex. * @magiclist: Hash of used authentication tokens. Protected by struct_mutex. * @magicfree: List of used authentication tokens. Protected by struct_mutex. * @lock: DRI lock information. @@ -585,7 +584,6 @@ struct drm_master { struct drm_minor *minor; char *unique; int unique_len; - int unique_size; struct drm_open_hash magiclist; struct list_head magicfree; struct drm_lock_data lock;