summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2017-08-31 20:06:12 +0200
committerGerd Hoffmann <kraxel@redhat.com>2017-11-10 12:45:35 +0100
commita86f25518e3ab7aec2d44b195835fd8d22d0eada (patch)
tree7e0e1f74d789467d8788f9b015768e6f8c8531fa
parent4013e44ffaf7eaed60fa39750a2944b774b9ea3f (diff)
downloadlinux-a86f25518e3ab7aec2d44b195835fd8d22d0eada.tar.bz2
virtgpu: remove redundant task_comm copying
Remove redundant task name copying because: 1. task->comm is already NUL-terminated 2. virtio_gpu_context_create() trims passed dbgname anyway Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Link: http://patchwork.freedesktop.org/patch/msgid/588612bbc672e8b598e10f79fcbc041122e844ba.1504202471.git.mirq-linux@rere.qmqm.pl Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--drivers/gpu/drm/virtio/virtgpu_kms.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c
index 6400506a06b0..65060c08522d 100644
--- a/drivers/gpu/drm/virtio/virtgpu_kms.c
+++ b/drivers/gpu/drm/virtio/virtgpu_kms.c
@@ -272,20 +272,18 @@ int virtio_gpu_driver_open(struct drm_device *dev, struct drm_file *file)
struct virtio_gpu_device *vgdev = dev->dev_private;
struct virtio_gpu_fpriv *vfpriv;
uint32_t id;
- char dbgname[64], tmpname[TASK_COMM_LEN];
+ char dbgname[TASK_COMM_LEN];
/* can't create contexts without 3d renderer */
if (!vgdev->has_virgl_3d)
return 0;
- get_task_comm(tmpname, current);
- snprintf(dbgname, sizeof(dbgname), "%s", tmpname);
- dbgname[63] = 0;
/* allocate a virt GPU context for this opener */
vfpriv = kzalloc(sizeof(*vfpriv), GFP_KERNEL);
if (!vfpriv)
return -ENOMEM;
+ get_task_comm(dbgname, current);
virtio_gpu_context_create(vgdev, strlen(dbgname), dbgname, &id);
vfpriv->ctx_id = id;