aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-08-29 06:12:42 -0400
committerDave Airlie <airlied@redhat.com>2014-09-10 03:42:17 -0400
commit1e444be0ef1bda2b180ecdedfa4c5d32bf236a5d (patch)
tree711321e9be107eb0ee0220176cbe912b14864e76
parentd0a39164b6adad0cec5046b6aad6b590cc9466cc (diff)
drm: drop unused drm_master->unique_size
This field is unused and there is really no reason to optimize unique-allocations. Drop it. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_ioctl.c1
-rw-r--r--drivers/gpu/drm/drm_pci.c4
-rw-r--r--drivers/gpu/drm/drm_platform.c1
-rw-r--r--include/drm/drmP.h2
4 files changed, 1 insertions, 7 deletions
diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
index aa1ac79bccbc..cb6b54aebd6f 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,
189 kfree(master->unique); 189 kfree(master->unique);
190 master->unique = NULL; 190 master->unique = NULL;
191 master->unique_len = 0; 191 master->unique_len = 0;
192 master->unique_size = 0;
193} 192}
194 193
195/** 194/**
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index 8efea6b4602b..e266927bb9f1 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)
138 return -ENOMEM; 138 return -ENOMEM;
139 139
140 master->unique_len = strlen(master->unique); 140 master->unique_len = strlen(master->unique);
141 master->unique_size = master->unique_len + 1;
142 return 0; 141 return 0;
143} 142}
144 143
@@ -149,8 +148,7 @@ int drm_pci_set_unique(struct drm_device *dev,
149 int domain, bus, slot, func, ret; 148 int domain, bus, slot, func, ret;
150 149
151 master->unique_len = u->unique_len; 150 master->unique_len = u->unique_len;
152 master->unique_size = u->unique_len + 1; 151 master->unique = kmalloc(master->unique_len + 1, GFP_KERNEL);
153 master->unique = kmalloc(master->unique_size, GFP_KERNEL);
154 if (!master->unique) { 152 if (!master->unique) {
155 ret = -ENOMEM; 153 ret = -ENOMEM;
156 goto err; 154 goto err;
diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c
index 0c09ddd50c15..f197a2b6911a 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
82 return -ENOMEM; 82 return -ENOMEM;
83 83
84 master->unique_len = strlen(master->unique); 84 master->unique_len = strlen(master->unique);
85 master->unique_size = master->unique_len;
86 return 0; 85 return 0;
87} 86}
88 87
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index a8b24fcddb8c..98b1eafebc1c 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -574,7 +574,6 @@ struct drm_gem_object {
574 * @minor: Link back to minor char device we are master for. Immutable. 574 * @minor: Link back to minor char device we are master for. Immutable.
575 * @unique: Unique identifier: e.g. busid. Protected by drm_global_mutex. 575 * @unique: Unique identifier: e.g. busid. Protected by drm_global_mutex.
576 * @unique_len: Length of unique field. Protected by drm_global_mutex. 576 * @unique_len: Length of unique field. Protected by drm_global_mutex.
577 * @unique_size: Amount allocated. Protected by drm_global_mutex.
578 * @magiclist: Hash of used authentication tokens. Protected by struct_mutex. 577 * @magiclist: Hash of used authentication tokens. Protected by struct_mutex.
579 * @magicfree: List of used authentication tokens. Protected by struct_mutex. 578 * @magicfree: List of used authentication tokens. Protected by struct_mutex.
580 * @lock: DRI lock information. 579 * @lock: DRI lock information.
@@ -585,7 +584,6 @@ struct drm_master {
585 struct drm_minor *minor; 584 struct drm_minor *minor;
586 char *unique; 585 char *unique;
587 int unique_len; 586 int unique_len;
588 int unique_size;
589 struct drm_open_hash magiclist; 587 struct drm_open_hash magiclist;
590 struct list_head magicfree; 588 struct list_head magicfree;
591 struct drm_lock_data lock; 589 struct drm_lock_data lock;