From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 16/20] drm: drop unused drm_master->unique_size Date: Fri, 29 Aug 2014 14:58:42 +0200 Message-ID: <20140829125842.GJ15520@phenom.ffwll.local> References: <1409307166-12396-1-git-send-email-dh.herrmann@gmail.com> <1409307166-12396-17-git-send-email-dh.herrmann@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-we0-f173.google.com (mail-we0-f173.google.com [74.125.82.173]) by gabe.freedesktop.org (Postfix) with ESMTP id 8C7636E6DE for ; Fri, 29 Aug 2014 05:58:21 -0700 (PDT) Received: by mail-we0-f173.google.com with SMTP id t60so2158529wes.32 for ; Fri, 29 Aug 2014 05:58:20 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1409307166-12396-17-git-send-email-dh.herrmann@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: David Herrmann Cc: Daniel Vetter , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Fri, Aug 29, 2014 at 12:12:42PM +0200, David Herrmann wrote: > This field is unused and there is really no reason to optimize > unique-allocations. Drop it. > > Signed-off-by: David Herrmann 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; > -- > 2.1.0 > -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch